From 7babef2b8886d5351fe262eef53d9dcb87fe8c90 Mon Sep 17 00:00:00 2001 From: Dominik Hebeler <dominik@suma-ev.de> Date: Thu, 12 May 2022 14:43:00 +0200 Subject: [PATCH] removed composer image cleanup as its not needed anymore --- .gitlab/ci/build_docker_images.yml | 8 -------- .gitlab/deployment_scripts/cleanup_tags_non_revision.sh | 6 +++--- .gitlab/deployment_scripts/cleanup_tags_revision.sh | 4 ++-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.gitlab/ci/build_docker_images.yml b/.gitlab/ci/build_docker_images.yml index a4f64886f..81715f214 100644 --- a/.gitlab/ci/build_docker_images.yml +++ b/.gitlab/ci/build_docker_images.yml @@ -32,14 +32,6 @@ nginx: after_script: - docker logout $CI_REGISTRY -cleanup_composer_image: - stage: build_docker_images - image: curlimages/curl - needs: - - composer - script: - - 'curl -X DELETE --fail -H "JOB-TOKEN: $CI_JOB_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/registry/repositories/418/tags/$DOCKER_COMPOSER_IMAGE_TAG"' - .cleanup_revision_images: stage: build_docker_images image: $DEPLOY_KUBERNETES_IMAGE diff --git a/.gitlab/deployment_scripts/cleanup_tags_non_revision.sh b/.gitlab/deployment_scripts/cleanup_tags_non_revision.sh index 6661336ff..3fef70424 100755 --- a/.gitlab/deployment_scripts/cleanup_tags_non_revision.sh +++ b/.gitlab/deployment_scripts/cleanup_tags_non_revision.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + FPM_REPOSITORY_ID=418 NGINX_REPOSITORY_ID=416 @@ -19,7 +21,6 @@ do existing_tags_fpm[$tag]=1 fi done - headers=$(cat /tmp/headers.txt) while read header do header=$(echo $header | sed -r 's/\s+//g') @@ -53,7 +54,6 @@ do existing_tags_nginx[$tag]=1 fi done - headers=$(cat /tmp/headers.txt) while read header do header=$(echo $header | sed -r 's/\s+//g') @@ -109,7 +109,7 @@ do if [[ ! -v revision_tags_nginx["$nginx_tag"] ]] then echo $nginx_tag - curl --fail --silent -X DELETE -H "JOB-TOKEN: $CI_JOB_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/registry/repositories/$FPM_REPOSITORY_ID/tags/$nginx_tag" + curl --fail --silent -X DELETE -H "JOB-TOKEN: $CI_JOB_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/registry/repositories/$NGINX_REPOSITORY_ID/tags/$nginx_tag" echo "" fi done \ No newline at end of file diff --git a/.gitlab/deployment_scripts/cleanup_tags_revision.sh b/.gitlab/deployment_scripts/cleanup_tags_revision.sh index fd4681e0d..a19c016e4 100755 --- a/.gitlab/deployment_scripts/cleanup_tags_revision.sh +++ b/.gitlab/deployment_scripts/cleanup_tags_revision.sh @@ -52,13 +52,13 @@ done for fpm_tag in ${!expired_fpm_tags[@]} do echo "Deleting fpm tag $fpm_tag" - curl --fail -X DELETE -H "JOB-TOKEN: $CI_JOB_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/registry/repositories/$FPM_REPOSITORY_ID/tags/$fpm_tag" + curl --fail --silent -X DELETE -H "JOB-TOKEN: $CI_JOB_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/registry/repositories/$FPM_REPOSITORY_ID/tags/$fpm_tag" echo "" done # Delete all gathered nginx tags for nginx_tag in ${!expired_nginx_tags[@]} do echo "Deleting nginx tag $nginx_tag" - curl --fail -X DELETE -H "JOB-TOKEN: $CI_JOB_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/registry/repositories/$FPM_REPOSITORY_ID/tags/$nginx_tag" + curl --fail --silent -X DELETE -H "JOB-TOKEN: $CI_JOB_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/registry/repositories/$FPM_REPOSITORY_ID/tags/$nginx_tag" echo "" done \ No newline at end of file -- GitLab