Commit 15079f61 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

deleting empty image tag

parent 70922e51
......@@ -39,6 +39,8 @@ nginx:
needs:
- composer
variables:
FPM_REPOSITORY_ID: 418
NGINX_REPOSITORY_ID: 416
KEEP_N: 9 # Trim to the latest 9 revisions as the 10th will be deleted in the next stage
before_script:
- chmod go-r $KUBECONFIG
......
......@@ -71,9 +71,14 @@ stop_review:
variables:
DEPLOYMENT_CHART_NAME: review-${CI_COMMIT_REF_SLUG}
KEEP_N: 0 # Environment gets deleted. No Image Tags to keep
FPM_REPOSITORY_ID: 418
NGINX_REPOSITORY_ID: 416
script:
- echo "Removing Image Tags..."
- .gitlab/deployment_scripts/cleanup_tags_revision.sh
# For some reason an empty image tag gets created for this. We need to delete it until we find out why that is
- '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/$DOCKER_IMAGE_TAG_PREFIX"'
- '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/$DOCKER_IMAGE_TAG_PREFIX"'
- echo "Stopping Deployment..."
- kubectl -n $KUBE_NAMESPACE delete secret $CI_COMMIT_REF_SLUG
- helm -n $KUBE_NAMESPACE delete $DEPLOYMENT_CHART_NAME
......
......@@ -2,9 +2,6 @@
set -e
FPM_REPOSITORY_ID=418
NGINX_REPOSITORY_ID=416
# Get All existing tags for the fpm repo
echo "Fetching existing fpm tags..."
declare -A existing_tags_fpm
......
......@@ -2,9 +2,6 @@
# Call script with KEEP_N variable set to specify the amount of releases to keep
FPM_REPOSITORY_ID=418
NGINX_REPOSITORY_ID=416
helm -n $KUBE_NAMESPACE history $HELM_RELEASE_NAME
if [ $? -ne 0 ]
then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment