Skip to content

Commit 3b96a6b

Browse files
author
Sheyla Trudo
committed
fixup! Template
1 parent 9c965d2 commit 3b96a6b

File tree

3 files changed

+64
-62
lines changed

3 files changed

+64
-62
lines changed

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

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,19 @@ parameters:
55

66
steps:
77
- task: AzureCLI@2
8-
displayName: "Login"
9-
inputs:
10-
azureSubscription: $(ACR_ARM_SERVICE_CONNECTION)
11-
scriptLocation: "inlineScript"
12-
scriptType: "bash"
13-
inlineScript: |
14-
az acr login -n $(ACR)
15-
16-
- script: |
17-
set -e
18-
if [ "$IN_OS" = 'windows' ]; then export BUILDX_ACTION='--push'; fi
19-
make "$IMGNAME" OS="$IN_OS" ARCH="$IN_ARCH"
20-
name: image_build
21-
displayName: Image Build
22-
workingDirectory: $(ACN_DIR)
8+
displayName: "Image Build"
239
retryCountOnTaskFailure: 3
24-
env:
25-
IMGNAME: '${{ parameters.name }}-image'
26-
IN_OS: '${{ parameters.os }}'
27-
IN_ARCH: '${{ parameters.arch }}'
28-
29-
- task: AzureCLI@2
30-
displayName: "Logout"
3110
inputs:
3211
azureSubscription: $(ACR_ARM_SERVICE_CONNECTION)
12+
addSpnToEnvironment: True
3313
scriptLocation: "inlineScript"
3414
scriptType: "bash"
3515
inlineScript: |
36-
docker logout
37-
16+
set -e
17+
make "$MAKE_CMD"
18+
env:
19+
OS: ${{ parameters.os }}
20+
ARCH: ${{ parameters.arch }}
21+
MAKE_CMD: ${{ parameters.name }}-image
22+
${{ if eq(parameters.os, 'windows') }}:
23+
BUILDX_ACTION: '--push'

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

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ steps:
1515
1616
- script: |
1717
set -e
18-
make ${{ parameters.name }}-manifest-build PLATFORMS="${{ parameters.platforms }}"
19-
workingDirectory: $(ACN_DIR)
18+
make ${{ parameters.name }}-manifest-build PLATFORMS="${{ parameters.platforms }}"
2019
name: manifest_build
2120
displayName: Manifest Build
2221
retryCountOnTaskFailure: 3
@@ -35,19 +34,9 @@ steps:
3534
make ${{ parameters.name }}-skopeo-archive IMAGE_ARCHIVE_DIR=$(Build.ArtifactStagingDirectory)/images
3635
name: manifest_push
3736
displayName: Manifest Push
38-
workingDirectory: $(ACN_DIR)
3937
retryCountOnTaskFailure: 3
4038
41-
- task: AzureCLI@2
42-
displayName: "Logout"
43-
inputs:
44-
azureSubscription: $(ACR_ARM_SERVICE_CONNECTION)
45-
scriptLocation: "inlineScript"
46-
scriptType: "bash"
47-
inlineScript: |
48-
docker logout
49-
50-
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
51-
displayName: "Add SBOM Generator tool"
39+
- task: 1ES.PublishPipelineArtifact@1
5240
inputs:
53-
BuildDropPath: "$(Build.ArtifactStagingDirectory)"
41+
artifactName: "output"
42+
targetPath: "$(Build.ArtifactStagingDirectory)"

.pipelines/run-pipeline.yaml

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
stages:
22
- stage: setup
3-
variables:
4-
ACN_DIR: $(Build.SourcesDirectory)
53
displayName: ACN
64
jobs:
75
- job: env
86
displayName: Setup
97
pool:
108
name: "$(BUILD_POOL_NAME_DEFAULT)"
9+
os: linux
1110
steps:
1211
- script: |
1312
# To use the variables below, you must make the respective stage's dependsOn have - setup or it will not retain context of this stage
@@ -38,44 +37,63 @@ stages:
3837
dependsOn:
3938
- setup
4039
- test
41-
variables:
42-
ACN_DIR: $(Build.SourcesDirectory)
4340
jobs:
4441
- job: build
4542
displayName: Build Binaries
4643
variables:
4744
STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ]
4845
pool:
4946
name: "$(BUILD_POOL_NAME_DEFAULT)"
47+
os: linux
5048
steps:
51-
- checkout: self
49+
- task: GoTool@0
50+
inputs:
51+
version: $(GO_VERSION)
52+
5253
- script: |
5354
make ipv6-hp-bpf-lib
5455
make all-binaries-platforms
55-
name: "BuildAllPlatformBinaries"
5656
displayName: "Build all platform binaries"
5757
58+
- script: |
59+
mkdir -p ./output/bins
60+
cd ./output
61+
find . -name '*.tgz' -print -exec mv -t ./bins/ {} +
62+
find . -name '*.zip' -print -exec mv -t ./bins/ {} +
63+
shopt -s extglob
64+
rm -rf !("bins")
65+
name: "PrepareArtifacts"
66+
displayName: "Prepare Artifacts"
67+
68+
- task: CopyFiles@2
69+
inputs:
70+
sourceFolder: "output"
71+
targetFolder: $(Build.ArtifactStagingDirectory)
72+
73+
- task: 1ES.PublishPipelineArtifact@1
74+
inputs:
75+
artifactName: "output"
76+
targetPath: "$(Build.ArtifactStagingDirectory)"
77+
5878
- stage: containerize
5979
displayName: Build Images
6080
dependsOn:
6181
- setup
6282
- test
63-
variables:
64-
ACN_DIR: $(Build.SourcesDirectory)
6583
jobs:
6684
- job: containerize_amd64
6785
displayName: Build Images
6886
pool:
6987
name: "$(BUILD_POOL_NAME_LINUX_AMD64)"
88+
os: linux
7089
strategy:
7190
maxParallel: 4
7291
matrix:
7392
azure_ipam_linux_amd64:
7493
arch: amd64
7594
name: azure-ipam
7695
os: linux
77-
azure_ipam_windows_amd64:
78-
Suffix: azure_ipam_windows_amd64
96+
azure_ipam_windows:
7997
arch: amd64
8098
name: azure-ipam
8199
os: windows
@@ -84,10 +102,17 @@ stages:
84102
name: cni
85103
os: linux
86104
cni_windows_amd64:
87-
Suffix: cni_windows_amd64
88105
arch: amd64
89106
name: cni
90107
os: windows
108+
cns_linux_amd64:
109+
arch: amd64
110+
name: cns
111+
os: linux
112+
cns_windows_amd64:
113+
arch: amd64
114+
name: cns
115+
os: windows
91116
ipv6_hp_bpf_linux_amd64:
92117
arch: amd64
93118
name: ipv6-hp-bpf
@@ -97,26 +122,24 @@ stages:
97122
name: npm
98123
os: linux
99124
npm_windows_amd64:
100-
Suffix: npm_windows_amd64
101125
arch: amd64
102126
name: npm
103127
os: windows
104-
variables:
105-
ob_git_checkout: true
106-
ob_artifactSuffix: $(Suffix) # this is needed to not collide published artifact containers
107-
ob_outputDirectory: $(System.ArtifactStagingDirectory)
108128
steps:
109-
- checkout: self
110-
- template: containers/container-template.yaml
129+
- task: GoTool@0
130+
inputs:
131+
version: $(GO_VERSION)
132+
- template: containers/container-template.steps.yaml
111133
parameters:
112134
arch: $(arch)
113135
name: $(name)
114136
os: $(os)
115-
137+
os_version: $(os_version)
116138
- job: containerize_linux_arm64
117139
displayName: Build Images
118140
pool:
119141
name: "$(BUILD_POOL_NAME_LINUX_ARM64)"
142+
os: linux
120143
strategy:
121144
maxParallel: 4
122145
matrix:
@@ -141,8 +164,7 @@ stages:
141164
name: npm
142165
os: linux
143166
steps:
144-
- checkout: self
145-
- template: containers/container-template.yaml
167+
- template: containers/container-template.steps.yaml
146168
parameters:
147169
arch: $(arch)
148170
name: $(name)
@@ -154,12 +176,12 @@ stages:
154176
- containerize
155177
variables:
156178
Packaging.EnableSBOMSigning: false
157-
ACN_DIR: $(Build.SourcesDirectory)
158179
jobs:
159180
- job: manifest
160181
displayName: Compile Manifests
161182
pool:
162183
name: "$(BUILD_POOL_NAME_DEFAULT)"
184+
os: linux
163185
strategy:
164186
maxParallel: 4
165187
matrix:
@@ -179,7 +201,10 @@ stages:
179201
name: npm
180202
platforms: linux/amd64 linux/arm64 windows/amd64
181203
steps:
182-
- template: containers/manifest-template.yaml
204+
- task: GoTool@0
205+
inputs:
206+
version: $(GO_VERSION)
207+
- template: containers/manifest-template.steps.yaml
183208
parameters:
184209
name: $(name)
185210
platforms: $(platforms)
@@ -366,6 +391,7 @@ stages:
366391
displayName: Delete Cluster
367392
pool:
368393
name: "$(BUILD_POOL_NAME_DEFAULT)"
394+
os: linux
369395
strategy:
370396
maxParallel: 4
371397
matrix:
@@ -430,6 +456,7 @@ stages:
430456
displayName: Delete Cluster
431457
pool:
432458
name: "$(BUILD_POOL_NAME_DEFAULT)"
459+
os: linux
433460
strategy:
434461
maxParallel: 4
435462
matrix:

0 commit comments

Comments
 (0)