/gitlab-artifact-cleanup

THIS PROJECT HAS BEEN MOVED TO GITLAB

Primary LanguagePythonMIT LicenseMIT

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.

Requirements

  • python-gitlab - Python GitLab API client (At least version 0.16)
  • python-dateutil - A robust ISO-8601 timestamp parser, among other things
  • pytz - Timezone info (Only required if you are using Python 2)

Usage

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.

License

This software is released under the MIT License.