Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
MetaGer
Commits
be20b670
Commit
be20b670
authored
2 years ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
pruning fpm and nginx tags
parent
b26c166d
No related branches found
No related tags found
2 merge requests
!1973
Development
,
!1934
Resolve "Update Images"
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab/ci/cleanup_tags.yml
+12
-1
12 additions, 1 deletion
.gitlab/ci/cleanup_tags.yml
with
12 additions
and
1 deletion
.gitlab/ci/cleanup_tags.yml
+
12
−
1
View file @
be20b670
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment