diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bab40b5be..9eec413e7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -247,13 +247,11 @@ deploy:bootstrap6: ## Cleanup... -cleanup: - <<: *dind_definition - stage: cleanup - script: - - ./scripts/delete_ci_image.sh gitlab-ci-token "${CI_BUILD_TOKEN}" - "${CI_PROJECT_PATH_SLUG}/build" - "${CI_BUILD_REF}" - ## Temporary allowed failure until image deletion is allowed on gitlab - ## https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13248 - allow_failure: true +# cleanup: + # <<: *dind_definition + # stage: cleanup + # script: + # - apk add -U curl jq + # - ./scripts/delete_ci_image.sh gitlab-ci-token "${CI_BUILD_TOKEN}" + # "${CI_PROJECT_PATH}/build" + # "${CI_BUILD_REF}" diff --git a/scripts/create_docker_image.build_deps.sh b/scripts/create_docker_image.build_deps.sh index 2ebf798a3..9ee604bb7 100755 --- a/scripts/create_docker_image.build_deps.sh +++ b/scripts/create_docker_image.build_deps.sh @@ -13,7 +13,7 @@ cached_image="${3:-}" base_image="tezos/opam:alpine-${alpine_version}_ocaml-${ocaml_version}" if ! docker pull "$base_image" ; then - ./create_docker_image.alpine.sh + ./scripts/create_docker_image.alpine.sh fi cleanup () { @@ -59,7 +59,7 @@ echo if [ ! -z "$cached_image" ]; then echo - echo "### Saving socker image ($cached_image)..." + echo "### Saving docker image ($cached_image)..." echo docker tag "$image_name:$image_version" \ "$cached_image:$dependencies_sha1" diff --git a/scripts/delete_ci_image.sh b/scripts/delete_ci_image.sh index 5610e3eb2..0dee46cbe 100755 --- a/scripts/delete_ci_image.sh +++ b/scripts/delete_ci_image.sh @@ -22,11 +22,12 @@ getTagDigest() { local token=$1 local reponame=$2 local tag=$3 - local id=$(curl -s -H "Authorization: Bearer ${token}" \ - -D - -o /dev/null \ + local digest="$(curl -s -H "Authorization: Bearer ${token}" \ + -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \ + --head \ "${registry_uri}/${reponame}/manifests/${tag}" | \ - grep Docker-Content-Digest | tr -d '\r') - echo -n "${id##Docker-Content-Digest: }" + grep Docker-Content-Digest | tr -d '\r')" + echo -n "${digest##Docker-Content-Digest: }" } deleteDigest() {