Skip to content

Commit 8cbdf0e

Browse files
author
Sheyla Trudo
committed
Clean up
1 parent 2e67633 commit 8cbdf0e

11 files changed

+112
-265
lines changed
File renamed without changes.
File renamed without changes.

.pipelines/containers/build-variables-template.steps.yaml

Lines changed: 61 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,66 @@ parameters:
2222

2323

2424
steps:
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

.pipelines/containers/build-variables-template.windows.steps.yaml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.pipelines/containers/container-template.jobs.yaml

Lines changed: 0 additions & 72 deletions
This file was deleted.

.pipelines/containers/container-template.steps.yaml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.pipelines/containers/containerize.jobs.yaml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ jobs:
3737
- ${{ each imageName in parameters.images }}:
3838
- job: ${{ replace(format('{0}_{1}_{2}', imageName, parameters.targetOs, parameters.targetArch), '-', '_') }}
3939
displayName: Build Image - (${{ imageName }} ${{ parameters.targetOs }}/${{ parameters.targetArch }})
40-
variables:
40+
41+
variables:
4142
buildPlatform: ${{ parameters.buildOs }}/${{ parameters.buildArch }}
4243
targetPlatform: ${{ parameters.targetOs }}/${{ parameters.targetArch }}
4344

@@ -60,20 +61,13 @@ jobs:
6061
# - BUILD_CONTEXT_${image}_${OS}_${ARCH}}
6162
# - IMAGE_PLATFORM_TAG_${image}_${OS}_${ARCH}}
6263
# - EXTRA_BUILD_ARGS_$${image}_${OS}_${ARCH}}
63-
- ${{ if eq(parameters.targetOs, 'windows') }}:
64-
- template: /.pipelines/containers/build-variables-template.windows.steps.yaml
65-
parameters:
66-
targetOs: ${{ parameters.targetOs }}
67-
targetArch: ${{ parameters.targetArch }}
68-
image: ${{ imageName }}
69-
- ${{ else }}:
70-
- template: /.pipelines/containers/build-variables-template.steps.yaml
71-
parameters:
72-
targetOs: ${{ parameters.targetOs }}
73-
targetArch: ${{ parameters.targetArch }}
74-
image: ${{ imageName }}
64+
- template: /.pipelines/containers/build-variables-template.steps.yaml
65+
parameters:
66+
targetOs: ${{ parameters.targetOs }}
67+
targetArch: ${{ parameters.targetArch }}
68+
image: ${{ imageName }}
7569

76-
- template: ./container-template.steps.yaml
70+
- template: ./containerize.steps.yaml
7771
parameters:
7872
imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }})
7973
dockerfilePath: $(DOCKERFILE_PATH_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }})

0 commit comments

Comments
 (0)