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

pruning fpm and nginx tags

parent b26c166d
No related branches found
No related tags found
2 merge requests!1973Development,!1934Resolve "Update Images"
......@@ -6,14 +6,25 @@
NGINX_IMAGE_REPOSITORY_ID: 416
script: |
# Delete all composer image tags for this branch as we don't need them anymore
echo "PRIVATE-TOKEN: $CI_JOB_TOKEN"
curl -X DELETE -k -H 'Content-Type: application/json' --fail \
-H "JOB-TOKEN: ${CI_JOB_TOKEN}" \
-i "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/registry/repositories/${FPM_IMAGE_REPOSITORY_ID}/tags" \
--data "{\"name_regex_delete\": \"$CI_COMMIT_REF_SLUG-composer-.*\"}"
# Delete all fpm tags but keeping the latest n ones (1 for review apps and 10 for development/master)
curl -X DELETE -k -H 'Content-Type: application/json' --fail \
-H "JOB-TOKEN: ${CI_JOB_TOKEN}" \
-i "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/registry/repositories/${FPM_IMAGE_REPOSITORY_ID}/tags" \
--data "{\"name_regex_delete\": \"$CI_COMMIT_REF_SLUG-.*\", \"keep_n\": $KEEP_TAGS}"
# Delete all nginx tags but keeping the latest n ones (1 for review apps and 10 for development/master)
curl -X DELETE -k -H 'Content-Type: application/json' --fail \
-H "JOB-TOKEN: ${CI_JOB_TOKEN}" \
-i "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/registry/repositories/${NGINX_IMAGE_REPOSITORY_ID}/tags" \
--data "{\"name_regex_delete\": \"$CI_COMMIT_REF_SLUG-.*\", \"keep_n\": $KEEP_TAGS}"
cleanup_tags_review:
extends: .cleanup_tags
variables:
KEEP_TAGS: 1
rules:
- if: '$CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "development"'
when: never
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment