Currently (as of GitLab 8.12) there are no admin tools for cleaning up build artifacts (see issue #18351). This script erases build artifacts using the GitLab API.
python-gitlab
- Python GitLab API client (At least version 0.16)python-dateutil
- A robust ISO-8601 timestamp parser, among other thingspytz
- Timezone info (Only required if you are using Python 2)
This script leverages the python-gitlab
config file.
Just like the gitlab
CLI tool, you can specify a non-default Gitlab server
with the -g
/--gitlab
option.
You can specify any number of projects with the -p
/--project
option:
$ gitlab-artifact-cleanup --project jreinhart/artifact-test --project jreinhart/python-gitlab
Or, you can cleanup all projects visible to you:
$ gitlab-artifact-cleanup --all-projects
Builds for tags are never removed.
This software is released under the MIT License.