Skip to content

Commit 1e0b646

Browse files
feat: passes the job number down to the child
1 parent 31d3948 commit 1e0b646

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

build/azDevOps/azure/azure-pipelines-javaspring-k8s.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,11 @@ stages:
319319
java_project_type: "${{ variables.java_project_type }}"
320320
functional_test_project_type: "${{ variables.functional_test_project_type }}"
321321

322+
- bash: |
323+
echo "##vso[task.setvariable variable=BUILD_ATTEMPT_NUMBER;isOutput=true]$(System.JobAttempt)"
324+
name: build_attempt_number
325+
displayName: "Output: Set Job Attempt Output Variable"
326+
322327
- stage: Dev
323328
dependsOn: Build
324329
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/master'))
@@ -334,6 +339,8 @@ stages:
334339
value: $(tf_core_resource_group_nonprod)
335340
- name: Environment.ShortName
336341
value: dev
342+
- name: BUILD_ATTEMPT_NUMBER
343+
value: "$[ dependencies.Build.ApiBuild.outputs['build_attempt_number.BUILT_ATTEMPT_NUMBER'] ]"
337344
jobs:
338345
- deployment: AppInfraDev
339346
container: terraform_custom
@@ -559,6 +566,8 @@ stages:
559566
value: $(tf_core_resource_group_prod)
560567
- name: Environment.ShortName
561568
value: prod
569+
- name: BUILD_ATTEMPT_NUMBER
570+
value: "$[ dependencies.Build.ApiBuild.outputs['build_attempt_number.BUILT_ATTEMPT_NUMBER'] ]"
562571
jobs:
563572
- deployment: AppInfraProd
564573
container: terraform_custom

build/azDevOps/azure/templates/steps/build/build-java.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ steps:
150150
- bash: |
151151
set -euxo pipefail
152152
cp "${{ parameters.repo_root_dir }}/build/azDevOps/azure/coverage/"* .
153-
npm i
153+
npm ci
154154
./node_modules/.bin/gulp inline-css-images
155155
./node_modules/.bin/gulp inline-sources
156156
workingDirectory: "${{ parameters.project_root_dir }}/target/site/"

build/azDevOps/azure/templates/steps/deploy/deploy-post-deploy-tests-karate.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ parameters:
1313
auth0_credentials: {}
1414
steps:
1515
- ${{ if eq(parameters.functional_test, true) }}:
16+
# $(BUILD_ATTEMPT_NUMBER) comes from the Stage Variables and is an output from the ApiBuild job
1617
- download: current
17-
artifact: "${{ parameters.functional_test_artefact_name }}"
18+
artifact: "${{ parameters.functional_test_artefact_name }}-$(BUILD_ATTEMPT_NUMBER)"
1819
displayName: "Download: Post-Deploy Test Artefacts"
1920

2021
# Files downloaded from artefacts seem to lose their permissions...

build/azDevOps/azure/templates/steps/deploy/deploy-post-deploy-tests-serenity.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ parameters:
1313
auth0_credentials: {}
1414
steps:
1515
- ${{ if eq(parameters.functional_test, true) }}:
16+
# $(BUILD_ATTEMPT_NUMBER) comes from the Stage Variables and is an output from the ApiBuild job
1617
- download: current
17-
artifact: "${{ parameters.functional_test_artefact_name }}"
18+
artifact: "${{ parameters.functional_test_artefact_name }}-$(BUILD_ATTEMPT_NUMBER)"
1819
displayName: "Download: Post-Deploy Test Artefacts"
1920

2021
# Files downloaded from artefacts seem to lose their permissions...

0 commit comments

Comments
 (0)