@@ -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 }}
0 commit comments