mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-08 17:42:56 +01:00
Merge branch 'fix-report-job-when-no-built-images' into 'master'
Ensure report-built-images doesn't fail when no images were built See merge request https://gitlab.com/gitlab-org/gitlab-build-images/-/merge_requests/817 Merged-by: Rémy Coutable <remy@rymai.me> Approved-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
commit
0e91d03527
2 changed files with 14 additions and 2 deletions
|
|
@ -57,6 +57,7 @@
|
|||
-t "$CI_REGISTRY_IMAGE:$IMAGE_NAME" \
|
||||
-f "Dockerfile.$IMAGE_NAME" \
|
||||
.
|
||||
- 'echo "${CI_JOB_URL}: ${IMAGE_NAME}" > "${CI_JOB_ID}-${CI_JOB_NAME_SLUG}-built-image.txt"'
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "schedule"'
|
||||
when: never
|
||||
|
|
|
|||
|
|
@ -2,8 +2,19 @@ report-built-images:
|
|||
image: alpine
|
||||
stage: report
|
||||
script:
|
||||
- cat *-built-image.txt > all-built-images.txt
|
||||
- cat all-built-images.txt
|
||||
- |
|
||||
set -- "${CI_PROJECT_DIR}"/*-built-image.txt
|
||||
|
||||
while [ "$#" -gt 0 ] && [ ! -f "$1" ]; do
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -f "$1" ]; then
|
||||
cat *-built-image.txt > all-built-images.txt
|
||||
cat all-built-images.txt
|
||||
else
|
||||
echo "No images built";
|
||||
fi
|
||||
artifacts:
|
||||
paths: ["all-built-images.txt"]
|
||||
expire_in: 90d
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue