Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eic_container
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
containers
eic_container
Commits
48b419a0
Commit
48b419a0
authored
1 year ago
by
Wouter Deconinck
Browse files
Options
Downloads
Patches
Plain Diff
feat: clean old pipelines
parent
0f0cbf52
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+32
-0
32 additions, 0 deletions
.gitlab-ci.yml
with
32 additions
and
0 deletions
.gitlab-ci.yml
+
32
−
0
View file @
48b419a0
...
@@ -545,3 +545,35 @@ clean_unstable_mr:
...
@@ -545,3 +545,35 @@ clean_unstable_mr:
done
done
-
docker system prune --filter until=24h --force
-
docker system prune --filter until=24h --force
-
docker images
-
docker images
clean_pipeline
:
extends
:
.docker
stage
:
config
dependencies
:
-
version
tags
:
-
docker-new
when
:
always
script
:
-
apk add curl jq
-
for registry in
eicweb
eicweb.phy.anl.gov:4567/containers/eic_container
; do
docker images
--filter=reference=${registry}/*:pipeline-*
--format "{{.ID}} {{.Repository}} {{.Tag}}" ;
done
| sed -n -E 's/pipeline-([0-9]+)(-nightly|-default){0,1}$/& \1/p'
| while read id repository tag pipeline_id ; do
status=$(curl --silent -L
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${pipeline_id}"
| jq -r ".[]|.status") ;
echo "Image $repository:$tag is ${status:-undetermined} (pipeline ${pipeline_id})." ;
[ "$status" == "success" ] && echo docker rmi $repository:$tag ;
[ "$status" == "failed" ] && echo docker rmi $repository:$tag ;
[ "$status" == "canceled" ] && echo docker rmi $repository:$tag ;
done
-
docker system prune --filter until=24h --force
-
docker images
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