@@ -8,41 +8,55 @@ parameters:
88- name : images
99 type : object
1010
11+ - name : pushAcr
12+ type : string
13+
1114
1215jobs :
1316- ${{ each image in split(parameters.images, '\n') }} :
1417 - job : ${{ image }}_${{ parameters.os }}_${{ parameters.arch }}
1518 displayName : Build Image - (${{ image }} ${{ parameters.os }}/${{ parameters.arch }})
16-
19+
1720 steps :
18- - task : GoTool@0
19- inputs :
20- version : $(GO_VERSION)
21-
22- - bash : |
23- set -e
24-
25- BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT")
26- echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT"
27-
28- IMAGE_NAME_AND_TAG=$(make "$MAKE_IMG_NAME_AND_TAG")
29- echo >&2 "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_${VAR_ID};]$IMAGE_NAME_AND_TAG"
30-
31- DOCKERFILE_PATH=$(make "$MAKE_DOCKERFILE_PATH")
32- echo >&2 "##vso[task.setvariable variable=DOCKERFILE_PATH_${VAR_ID};]$DOCKERFILE_PATH"
33-
34- EXTRA_BUILD_ARGS=$(make "$MAKE_EXTRA_BUILD_ARGS")
35- echo >&2 "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_${VAR_ID};]$EXTRA_BUILD_ARGS"
36- displayName: "Get Image Name"
37- env:
38- VAR_ID: ${{ parameters.name }}
39- MAKE_BUILD_CONTEXT: ${{ parameters.name }}-image-build-context
40- MAKE_IMG_NAME_AND_TAG: ${{ parameters.name }}-image-name-and-tag
41- MAKE_DOCKERFILE_PATH: ${{ parameters.name }}-image-dockerfile-path
42- MAKE_EXTRA_BUILD_ARGS: ${{ parameters.name }}-image-build-args
43-
44- - template : containers/container-template.steps.yaml
45- parameters :
46- arch : ${{ parameters.arch }}
47- name : ${{ parameters.name }}
48- os : ${{ parameters.os }}
21+ - task : GoTool@0
22+ inputs :
23+ version : $(GO_VERSION)
24+
25+ - task : AzureCLI@2
26+ inputs :
27+ azureSubscription : $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
28+ scriptLocation : " inlineScript"
29+ scriptType : " bash"
30+ addSpnToEnvironment : true
31+ inlineScript : |
32+ az acr login --name "$ACR"
33+ env :
34+ ACR : ${{ parameters.pushAcr }}
35+
36+ - bash : |
37+ set -e
38+
39+ BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT")
40+ echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT"
41+
42+ IMAGE_NAME_AND_TAG=$(make "$MAKE_IMG_NAME_AND_TAG")
43+ echo >&2 "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_${VAR_ID};]$IMAGE_NAME_AND_TAG"
44+
45+ DOCKERFILE_PATH=$(make "$MAKE_DOCKERFILE_PATH")
46+ echo >&2 "##vso[task.setvariable variable=DOCKERFILE_PATH_${VAR_ID};]$DOCKERFILE_PATH"
47+
48+ EXTRA_BUILD_ARGS=$(make "$MAKE_EXTRA_BUILD_ARGS")
49+ echo >&2 "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_${VAR_ID};]$EXTRA_BUILD_ARGS"
50+ displayName: "Get Image Name"
51+ env:
52+ VAR_ID: ${{ parameters.name }}
53+ MAKE_BUILD_CONTEXT: ${{ parameters.name }}-image-build-context
54+ MAKE_IMG_NAME_AND_TAG: ${{ parameters.name }}-image-name-and-tag
55+ MAKE_DOCKERFILE_PATH: ${{ parameters.name }}-image-dockerfile-path
56+ MAKE_EXTRA_BUILD_ARGS: ${{ parameters.name }}-image-build-args
57+
58+ - template : containers/container-template.steps.yaml
59+ parameters :
60+ arch : ${{ parameters.arch }}
61+ name : ${{ parameters.name }}
62+ os : ${{ parameters.os }}
0 commit comments