Skip to content
Snippets Groups Projects
Commit 15079f61 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

deleting empty image tag

parent 70922e51
No related branches found
No related tags found
2 merge requests!1973Development,!1934Resolve "Update Images"
...@@ -39,6 +39,8 @@ nginx: ...@@ -39,6 +39,8 @@ nginx:
needs: needs:
- composer - composer
variables: 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 KEEP_N: 9 # Trim to the latest 9 revisions as the 10th will be deleted in the next stage
before_script: before_script:
- chmod go-r $KUBECONFIG - chmod go-r $KUBECONFIG
......
...@@ -71,9 +71,14 @@ stop_review: ...@@ -71,9 +71,14 @@ stop_review:
variables: variables:
DEPLOYMENT_CHART_NAME: review-${CI_COMMIT_REF_SLUG} DEPLOYMENT_CHART_NAME: review-${CI_COMMIT_REF_SLUG}
KEEP_N: 0 # Environment gets deleted. No Image Tags to keep KEEP_N: 0 # Environment gets deleted. No Image Tags to keep
FPM_REPOSITORY_ID: 418
NGINX_REPOSITORY_ID: 416
script: script:
- echo "Removing Image Tags..." - echo "Removing Image Tags..."
- .gitlab/deployment_scripts/cleanup_tags_revision.sh - .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..." - echo "Stopping Deployment..."
- kubectl -n $KUBE_NAMESPACE delete secret $CI_COMMIT_REF_SLUG - kubectl -n $KUBE_NAMESPACE delete secret $CI_COMMIT_REF_SLUG
- helm -n $KUBE_NAMESPACE delete $DEPLOYMENT_CHART_NAME - helm -n $KUBE_NAMESPACE delete $DEPLOYMENT_CHART_NAME
......
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
set -e set -e
FPM_REPOSITORY_ID=418
NGINX_REPOSITORY_ID=416
# Get All existing tags for the fpm repo # Get All existing tags for the fpm repo
echo "Fetching existing fpm tags..." echo "Fetching existing fpm tags..."
declare -A existing_tags_fpm declare -A existing_tags_fpm
......
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
# Call script with KEEP_N variable set to specify the amount of releases to keep # 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 helm -n $KUBE_NAMESPACE history $HELM_RELEASE_NAME
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment