Skip to content

Commit 5bb57f1

Browse files
committed
Testing default registry host value in pipeline
1 parent 56098cb commit 5bb57f1

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

.azuredevops/templates/steps/tf_plan.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
parameters:
44
- name: tfCommandOptions
5-
type: string
65
default: ''
7-
- name: imageHash
8-
type: string
9-
default: ''
10-
- name: registryHost
11-
type: string
126

137
steps:
148
- template: tf_init.yaml
@@ -32,8 +26,8 @@ steps:
3226
commandOptions: >
3327
-input=false
3428
-var-file=$(tfVarsFile)
35-
-var="image_commit_hash=${{ parameters.imageHash }}"
36-
-var="registry_host=${{ parameters.registryHost }}"
29+
-var="image_commit_hash=$(imageHash)"
30+
-var="registry_host=$(registryHost)"
3731
${{ parameters.tfCommandOptions }}
3832
-out=$(Build.ArtifactStagingDirectory)/$(ENVIRONMENT).tfplan
3933
environmentServiceNameAzureRM: $(SERVICE_CONNECTION)

.github/workflows/stage-3-build.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ jobs:
235235
env:
236236
container_registry: ${{ env.REGISTRY_HOST }}
237237
docker_services: >-
238-
${{ join(fromJSON(needs.containers-to-build.outputs.docker_services || '[]'), ',') }}
238+
${{ needs.containers-to-build.outputs.docker_services && join(fromJSON(needs.containers-to-build.outputs.docker_services || '[]'), ',') }}
239239
run: |
240240
echo Running 'docker buildx imagetools' on remote repositories...
241241
@@ -261,15 +261,15 @@ jobs:
261261

262262
- name: Call deployment pipeline
263263
if: success()
264+
env:
265+
container_registry: ${{ env.REGISTRY_HOST }}
264266
run: |
265267
az pipelines run \
266268
--branch "main" \
267269
--name cd-infrastructure-dev-core \
268270
--org https://dev.azure.com/nhse-dtos \
269271
--project ${project_name} \
270-
--parameters \
271-
imageHash="${short_commit_hash}" \
272-
registryHost="${REGISTRY_HOST}"
272+
--parameters "imageHash=${short_commit_hash}" "registryHost=${container_registry,,}"
273273
274274
aggregate-reports:
275275
name: Aggregate reports

0 commit comments

Comments
 (0)