1 changed file
azure-pipelines.yml | ||
Add comment 60
Add comment 61 # Conditional insertion of stages or jobs
Add comment 62 jobs:
Add comment 63 Plus #condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
Add comment 64 Plus
Add comment 63 65 - template: templates/build-job.yml
Add comment 66 Plus
Add comment 64 67 # conditional - only run this job on the main branch - prevents people doing a manual run and selecting the wrong branch
Add comment 65 68 - ${{ if eq(variables['Build.SourceBranchName'], 'refs/heads/main') }}:
Add comment 66 69 - job: buildMainOnly
Add comment 178 181 #container: ubuntu:18.04
Add comment 179 182 services:
Add comment 180 183
Add comment 181 Minus jobs:
Add comment 182 Minus condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
Add comment 183 Minus
Add comment 184 steps:
Add comment 185 # Replaces the implicit checkout stepwith one that persists the credentials to pull and push changes to the same repo, such as GitOps release version updates
Add comment 186 #
Add comment 346 - script: |
Add comment 347 set -euxo pipefail
Add comment 348 git add -A
Add comment 349 Minus # copied from https://github.com/HariSekhon/Jenkins/blob/master/vars/gitKustomizeImage.groovy#L135
Add comment 349 Plus # copied from https://github.com/HariSekhon/Jenkins/blob/fa65824209e85445834f03330e1d19a9e65ba1b4/vars/gitKustomizeImage.groovy#L135
Add comment 350 if ! git diff-index --quiet HEAD; then
Add comment 351 git commit \
Add comment 352 -m "updated $(DIR)/fleet.yaml with version '$version', build queued by '$BUILD_QUEUEDBY', requested for '$BUILD_REQUESTEDFOR <$BUILD_REQUESTEDFOREMAIL>', pipeline version '$BUILD_DEFINITIONVERSION'" \