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

added cleanup job

parent 59bacd22
No related branches found
No related tags found
2 merge requests!1973Development,!1934Resolve "Update Images"
.cleanup_tags:
stage: deploy
image: curlimages/curl
variables:
FPM_IMAGE_REPOSITORY_ID: 415
NGINX_IMAGE_REPOSITORY_ID: 416
API_DELETE_PATH: /projects/$CI_PROJECT_ID/registry/repositories/:repository_id/tags
script:
# Delete all composer image tags for this branch as we don't need them anymore
- >
curl -X DELETE -k -H 'Content-Type: application/json'
-H "PRIVATE-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-.*\"}"
cleanup_tags_review:
extends: cleanup_tags
rules:
- if: '$CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "development"'
when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment