@@ -213,31 +213,33 @@ jobs:
213
213
if : inputs.seed
214
214
215
215
- name : Get built container images
216
- run : |
217
- docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/${{ matrix.distro }}-*:${{ needs.generate-tag.outputs.kolla_tag }}" > ${{ matrix.distro }}-container-images
216
+ run : docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/${{ matrix.distro }}-*:${{ needs.generate-tag.outputs.kolla_tag }}" > ${{ matrix.distro }}-container-images
218
217
219
218
- name : Fail if no images have been built
220
219
run : if [ $(wc -l < ${{ matrix.distro }}-container-images) -le 1 ]; then exit 1; fi
221
220
222
221
- name : Scan built container images
223
- run : |
224
- src/kayobe-config/tools/scan-images.sh ${{ matrix.distro }} ${{ needs.generate-tag.outputs.kolla_tag }}
222
+ run : src/kayobe-config/tools/scan-images.sh ${{ matrix.distro }} ${{ needs.generate-tag.outputs.kolla_tag }}
223
+
224
+ - name : Move image scan logs to output artifact
225
+ run : mv image-scan-output image-build-logs/image-scan-output
225
226
226
227
- name : Fail if no images have passed scanning
227
- run : if [ $(wc -l < image-scan-output/clean-images.txt) -le 0 ]; then exit 1; fi
228
+ run : if [ $(wc -l < image-build-logs/image- scan-output/clean-images.txt) -le 0 ]; then exit 1; fi
228
229
if : ${{ !inputs.push-dirty }}
229
230
230
231
- name : Copy clean images to push-attempt-images list
231
- run : cp image-scan-output/clean-images.txt image-scan-output/push-attempt-images.txt
232
+ run : cp image-build-logs/image-scan-output/clean-images.txt image-build-logs/push-attempt-images.txt
233
+ if : inputs.push
232
234
233
235
- name : Append dirty images to push list
234
236
run : |
235
- cat image-scan-output/dirty-images.txt >> image-scan-output /push-attempt-images.txt
236
- if : inputs.push-dirty
237
+ cat image-build-logs/image- scan-output/dirty-images.txt >> image-build-logs /push-attempt-images.txt
238
+ if : ${{ inputs.push && inputs.push -dirty }}
237
239
238
240
- name : Push images
239
241
run : |
240
- touch image-scan-output /push-failed-images.txt
242
+ touch image-build-logs /push-failed-images.txt
241
243
source venvs/kayobe/bin/activate &&
242
244
source src/kayobe-config/kayobe-env --environment ci-builder &&
243
245
kayobe playbook run ${KAYOBE_CONFIG_PATH}/ansible/docker-registry-login.yml &&
@@ -250,14 +252,13 @@ jobs:
250
252
break
251
253
elif $i == 5; then
252
254
echo "Failed to push $image"
253
- echo $image >> image-scan-output /push-failed-images.txt
255
+ echo $image >> image-build-logs /push-failed-images.txt
254
256
else
255
257
echo "Failed on retry $i"
256
258
sleep 5
257
259
fi;
258
260
done
259
- done < image-scan-output/push-attempt-images.txt &&
260
- mv image-scan-output image-build-logs/image-scan-output
261
+ done < image-build-logs/push-attempt-images.txt
261
262
shell : bash
262
263
env :
263
264
KAYOBE_VAULT_PASSWORD : ${{ secrets.KAYOBE_VAULT_PASSWORD }}
@@ -283,18 +284,15 @@ jobs:
283
284
run : if [ $(wc -l < image-build-logs/dirty-images.txt) -gt 0 ]; then cat image-build-logs/dirty-images.txt && exit 1; fi
284
285
if : ${{ !inputs.push-dirty && !cancelled() }}
285
286
286
- sync-container-repositories :
287
- name : Trigger container image repository sync
288
- needs :
289
- - container-image-build
290
- if : github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push
291
- runs-on : ubuntu-latest
292
- permissions : {}
293
- steps :
294
287
# NOTE(mgoddard): Trigger another CI workflow in the
295
288
# stackhpc-release-train repository.
296
289
- name : Trigger container image repository sync
297
290
run : |
291
+ sudo mkdir -p -m 755 /etc/apt/keyrings && wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
292
+ sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
293
+ echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
294
+ sudo apt update
295
+ sudo apt install gh -y
298
296
filter='${{ inputs.regexes }}'
299
297
if [[ -n $filter ]] && [[ ${{ inputs.seed }} == 'true' ]]; then
300
298
filter="$filter bifrost"
@@ -307,7 +305,9 @@ jobs:
307
305
-f sync-new-images=false
308
306
env :
309
307
GITHUB_TOKEN : ${{ secrets.STACKHPC_RELEASE_TRAIN_TOKEN }}
308
+ if : ${{ github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push && !cancelled() }}
310
309
311
310
- name : Display link to container image repository sync workflows
312
311
run : |
313
312
echo "::notice Container image repository sync workflows: https://github.com/stackhpc/stackhpc-release-train/actions/workflows/container-sync.yml"
313
+ if : ${{ github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push && !cancelled() }}
0 commit comments