Open Closed

DevOps with Abp #2214


User avatar
0
MILLENNIUM created

I am trying to create a CI/CD pipleline (with azure devops), I have a problem with using the DbMigrator project in that pipeline, I do not want to use abp credentials on the pipeline (to install abp and login with my account, and I have accounts) What are the alternative of creating the database and applying the migrations and seeding the default data.

I read the topic (https://docs.abp.io/en/abp/4.4/Data-Seeding) but I need an alternative way in production environment. (for example is there is a way that I reference the dbMigrator in the host to seed the data on startup)

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    You don't need to use abp login command in pipeline, just copy NuGet.Config that contains ABP_COMMERCIAL_NUGET_SOURCE.

    About using DbMigrator in pipeline; I do not know your deployment environment but If you are using kubernes, you can use Job.

    For DbMigrator helm template, you can use something similar to:

    apiVersion: batch/v1
    kind: Job
    metadata:
      name: {{ .Release.Name }}-{{ .Chart.Name }}
    spec:
      activeDeadlineSeconds: 180
      template:
        spec:
          containers:
          - image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
            imagePullPolicy: {{ .Values.image.pullPolicy }}
            name: {{ .Release.Name }}-{{ .Chart.Name }}
            env:
            - name: "ConnectionStrings__Default"
              value: {{ .Values.config.connectionStrings.default }}
            - name: "DOTNET_ENVIRONMENT"
              value: "{{ .Values.config.dotnetEnv }}"
              {{- if .Values.env }}
    {{ toYaml .Values.env | indent 8 }}
              {{- end }}
    
          restartPolicy: Never
      backoffLimit: 10
    

    Eventually, DbMigrator should be run as a console application.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.