diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db40864..4a0db16 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,8 +18,6 @@ default: image: ${BASE_BUILD_REGISTRY_IMAGE}/debian-bullseye-slim:docker-${DOCKER_VERSION} services: - docker:${DOCKER_VERSION}-dind - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY" tags: - gitlab-org-docker @@ -37,6 +35,7 @@ stages: - gitlab-cng - gitlab-kas - gitlab-workhorse + - report variables: DOCKER_HOST: tcp://docker:2375 @@ -44,7 +43,16 @@ variables: DOCKER_VERSION: "24.0.5" dont-interrupt-me: - extends: .dont-interrupt-me + stage: .pre + interruptible: false + script: + - echo "This jobs makes sure this pipeline won't be interrupted! See https://docs.gitlab.com/ee/ci/yaml/#interruptible." + rules: + - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH + allow_failure: true + - if: $CI_MERGE_REQUEST_IID + when: manual + allow_failure: true cache-chrome-chromium: extends: .cache-google-chrome diff --git a/.gitlab/ci/definitions.yml b/.gitlab/ci/definitions.yml index 48a777f..2cf9945 100644 --- a/.gitlab/ci/definitions.yml +++ b/.gitlab/ci/definitions.yml @@ -18,9 +18,16 @@ fi - docker buildx create --use # creates and set's to active buildkit builder +.with-built-image-artifact: + artifacts: + paths: ["*-built-image.txt"] + expire_in: 7d + .build_dynamic_image: stage: custom - extends: .install-qemu + extends: + - .install-qemu + - .with-built-image-artifact needs: [] script: - ./scripts/lib/custom-docker-build @@ -30,7 +37,9 @@ .build_static_image: stage: custom - extends: .install-qemu + extends: + - .install-qemu + - .with-built-image-artifact needs: [] script: # Hack to set an array in /bin/sh @@ -94,15 +103,3 @@ - if: '$CI_MERGE_REQUEST_IID' when: manual allow_failure: true - -.dont-interrupt-me: - stage: .pre - interruptible: false - script: - - echo "This jobs makes sure this pipeline won't be interrupted! See https://docs.gitlab.com/ee/ci/yaml/#interruptible." - rules: - - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH - allow_failure: true - - if: $CI_MERGE_REQUEST_IID - when: manual - allow_failure: true diff --git a/.gitlab/ci/report.yml b/.gitlab/ci/report.yml new file mode 100644 index 0000000..686c015 --- /dev/null +++ b/.gitlab/ci/report.yml @@ -0,0 +1,10 @@ +report-built-images: + image: alpine + stage: report + script: + - cat *-built-image.txt > all-built-images.txt + - cat all-built-images.txt + artifacts: + paths: ["all-built-images.txt"] + expire_in: 90d + diff --git a/scripts/lib/custom-docker-build b/scripts/lib/custom-docker-build index 64e6e09..741b222 100755 --- a/scripts/lib/custom-docker-build +++ b/scripts/lib/custom-docker-build @@ -494,6 +494,7 @@ function build_custom_if_needed() { run_command docker push "$full_image_name" fi fi + echo "${CI_JOB_URL}: $full_image_name" > "${CI_JOB_ID}-${CI_JOB_NAME_SLUG}-built-image.txt" printf "\n\nSUCCESS - Successfully built:\n\t%s\n" "$full_image_name" }