|
| 1 | +trigger: |
| 2 | +- main |
| 3 | +- azure-pipelines |
| 4 | + |
| 5 | +pool: |
| 6 | + name: "Standard-Linux" |
| 7 | +resources: |
| 8 | + repositories: |
| 9 | + - repository: templates |
| 10 | + type: git |
| 11 | + name: MPT/ops-build-templates-aks-releases |
| 12 | + ref: releases/v15 |
| 13 | + |
| 14 | +variables: |
| 15 | + - name: appName |
| 16 | + value: mpt-extension-finops |
| 17 | + |
| 18 | +stages: |
| 19 | + - stage: prepare |
| 20 | + displayName: "Prerequisites" |
| 21 | + jobs: |
| 22 | + - template: aks-docker-templates/build_prerequisites.yaml@templates |
| 23 | + - template: aks-docker-templates/build_artifacts.yaml@templates |
| 24 | + parameters: |
| 25 | + application: $(appName) |
| 26 | + |
| 27 | + - stage: build |
| 28 | + displayName: "Build" |
| 29 | + dependsOn: prepare |
| 30 | + variables: |
| 31 | + - template: aks-docker-templates/acr-creds-group.yaml@templates |
| 32 | + - group: swo.platform-build |
| 33 | + jobs: |
| 34 | + - job: build_image |
| 35 | + displayName: Build image |
| 36 | + variables: |
| 37 | + - name: buildVersion |
| 38 | + value: $[ stageDependencies.prepare.build_prerequisites.outputs['vars.BUILD_VERSION'] ] |
| 39 | + - name: majorVersion |
| 40 | + value: $[ split(variables.buildVersion, '.')[0] ] |
| 41 | + steps: |
| 42 | + - template: aks-docker-templates/docker-build-steps.yaml@templates |
| 43 | + parameters: |
| 44 | + repository: $(appName) |
| 45 | + sourceBuild: $(buildVersion) |
| 46 | + Dockerfile: prod.Dockerfile |
| 47 | + skipImagePush: ${{ eq(variables['Build.Reason'], 'PullRequest') }} |
| 48 | + |
| 49 | + - job: BuildHelmChart |
| 50 | + displayName: Build Helm Chart |
| 51 | + variables: |
| 52 | + - template: aks-docker-templates/acr-creds-group.yaml@templates |
| 53 | + - name: buildVersion |
| 54 | + value: $[ stageDependencies.prepare.build_prerequisites.outputs['vars.BUILD_VERSION'] ] |
| 55 | + steps: |
| 56 | + - template: aks-docker-templates/helm-build-steps.yaml@templates |
| 57 | + parameters: |
| 58 | + buildNumber: $(buildVersion) |
| 59 | + repository: $(appName) |
| 60 | + workingDirectory: helm/$(appName) |
| 61 | + skipImagePush: ${{ eq(variables['Build.Reason'], 'PullRequest') }} |
| 62 | + |
| 63 | + - stage: publish |
| 64 | + displayName: Publish |
| 65 | + dependsOn: |
| 66 | + - prepare |
| 67 | + - build |
| 68 | + jobs: |
| 69 | + - job: publish |
| 70 | + displayName: Publish |
| 71 | +# condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.SourceBranch'], 'refs/heads/release/4'), eq(variables['System.Debug'], true)) |
| 72 | + variables: |
| 73 | + - template: aks-docker-templates/acr-creds-group.yaml@templates |
| 74 | + - name: buildVersion |
| 75 | + value: $[ stageDependencies.prepare.build_prerequisites.outputs['vars.BUILD_VERSION'] ] |
| 76 | + steps: |
| 77 | + - template: aks-docker-templates/publish-steps.yaml@templates |
| 78 | + parameters: |
| 79 | + repository: $(appName) |
| 80 | + buildNumber: $(buildVersion) |
| 81 | + components: [] |
0 commit comments