@@ -22,33 +22,66 @@ parameters:
2222
2323
2424steps :
25- - bash : |
26- set -e
2725
28- VAR_ID="${IMAGE}_${OS}_${ARCH}"
26+ - ${{ if eq(parameters.targetOs, 'linux') }} :
27+ - bash : |
28+ set -e
29+
30+ VAR_ID="${IMAGE}_${OS}_${ARCH}"
31+
32+ BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT")
33+ echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT"
34+
35+ IMAGE_PLATFORM_TAG=$(make "$MAKE_IMAGE_TAG")
36+ echo >&2 "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_${VAR_ID};]$IMAGE_PLATFORM_TAG"
37+
38+ IMAGE_NAME_AND_TAG=$(make "$MAKE_IMAGE_NAME_AND_TAG")
39+ echo >&2 "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_${VAR_ID};]$IMAGE_NAME_AND_TAG"
40+
41+ DOCKERFILE_PATH=$(make "$MAKE_DOCKERFILE_PATH")
42+ echo >&2 "##vso[task.setvariable variable=DOCKERFILE_PATH_${VAR_ID};]$DOCKERFILE_PATH"
43+
44+ EXTRA_BUILD_ARGS=$(make "$MAKE_EXTRA_BUILD_ARGS")
45+ echo >&2 "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_${VAR_ID};]$EXTRA_BUILD_ARGS"
46+ displayName: "Get Image Build Data"
47+ env:
48+ IMAGE: ${{ parameters.image }}
49+ OS: ${{ parameters.targetOs }}
50+ ARCH: ${{ parameters.targetArch }}
51+ PLATFORM: ${{ parameters.targetOs }}/${{ parameters.targetArch }}
52+ MAKE_IMAGE_TAG: ${{ parameters.image }}-image-tag
53+ MAKE_BUILD_CONTEXT: ${{ parameters.image }}-image-build-context
54+ MAKE_IMAGE_NAME_AND_TAG: ${{ parameters.image }}-image-name-and-tag
55+ MAKE_DOCKERFILE_PATH: ${{ parameters.image }}-dockerfile-path
56+ MAKE_EXTRA_BUILD_ARGS: ${{ parameters.image }}-docker-build-args
2957
30- BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT")
31- echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT"
32-
33- IMAGE_PLATFORM_TAG=$(make "$MAKE_IMAGE_TAG")
34- echo >&2 "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_${VAR_ID};]$IMAGE_PLATFORM_TAG"
35-
36- IMAGE_NAME_AND_TAG=$(make "$MAKE_IMAGE_NAME_AND_TAG")
37- echo >&2 "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_${VAR_ID};]$IMAGE_NAME_AND_TAG"
38-
39- DOCKERFILE_PATH=$(make "$MAKE_DOCKERFILE_PATH")
40- echo >&2 "##vso[task.setvariable variable=DOCKERFILE_PATH_${VAR_ID};]$DOCKERFILE_PATH"
41-
42- EXTRA_BUILD_ARGS=$(make "$MAKE_EXTRA_BUILD_ARGS")
43- echo >&2 "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_${VAR_ID};]$EXTRA_BUILD_ARGS"
44- displayName : " Get Image Build Data"
45- env :
46- IMAGE : ${{ parameters.image }}
47- OS : ${{ parameters.targetOs }}
48- ARCH : ${{ parameters.targetArch }}
49- PLATFORM : ${{ parameters.targetOs }}/${{ parameters.targetArch }}
50- MAKE_IMAGE_TAG : ${{ parameters.image }}-image-tag
51- MAKE_BUILD_CONTEXT : ${{ parameters.image }}-image-build-context
52- MAKE_IMAGE_NAME_AND_TAG : ${{ parameters.image }}-image-name-and-tag
53- MAKE_DOCKERFILE_PATH : ${{ parameters.image }}-dockerfile-path
54- MAKE_EXTRA_BUILD_ARGS : ${{ parameters.image }}-docker-build-args
58+ - ${{ elseif eq(parameters.targetOs, 'windows') }} :
59+ - pwsh : |
60+ $env:VAR_ID = "$env:IMAGE_$env:OS_$env:ARCH"
61+
62+ $env:BUILD_CONTEXT = (make "$env:MAKE_BUILD_CONTEXT")
63+ Write-Host "##vso[task.setvariable variable=BUILD_CONTEXT_$env:VAR_ID;]$env:BUILD_CONTEXT"
64+
65+ $env:IMAGE_PLATFORM_TAG = (make "$env:MAKE_IMAGE_TAG")
66+ Write-Host "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_$env:VAR_ID;]$env:IMAGE_PLATFORM_TAG"
67+
68+ $env:IMAGE_NAME_AND_TAG = (make "$env:MAKE_IMAGE_NAME_AND_TAG")
69+ Write-Host "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_$env:VAR_ID;]$env:IMAGE_NAME_AND_TAG"
70+
71+ $env:DOCKERFILE_PATH = (make "$env:MAKE_DOCKERFILE_PATH")
72+ Write-Host "##vso[task.setvariable variable=DOCKERFILE_PATH_$env:VAR_ID;]$env:DOCKERFILE_PATH"
73+
74+ $env:EXTRA_BUILD_ARGS = (make "$env:MAKE_EXTRA_BUILD_ARGS")
75+ Write-Host "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_$env:VAR_ID;]$env:EXTRA_BUILD_ARGS"
76+ displayName: "Get Image Build Data"
77+ errorActionPreference: stop
78+ env:
79+ IMAGE: ${{ parameters.image }}
80+ OS: ${{ parameters.targetOs }}
81+ ARCH: ${{ parameters.targetArch }}
82+ PLATFORM: ${{ parameters.targetOs }}/${{ parameters.targetArch }}
83+ MAKE_IMAGE_TAG: ${{ parameters.image }}-image-tag
84+ MAKE_BUILD_CONTEXT: ${{ parameters.image }}-image-build-context
85+ MAKE_IMAGE_NAME_AND_TAG: ${{ parameters.image }}-image-name-and-tag
86+ MAKE_DOCKERFILE_PATH: ${{ parameters.image }}-dockerfile-path
87+ MAKE_EXTRA_BUILD_ARGS: ${{ parameters.image }}-docker-build-args
0 commit comments