Clean Gitlab Registry
50K+
This tool helps interaction with Gitlab Registry Delete API to keep a clean registry.
Is already made to be run inside a Gitlab CI job so it will try to take all base config from Gitlab CI ENV vars
pyenv install 3.7.0pyenv virtualenv 3.7.0 gitlab-registry-cleanerpyenv local gitlab-registry-cleanerpoetry installdocker build -t ovalmoney/gitlab-registry-cleaner:latest .
docker run -it --rm ovalmoney/gitlab-registry-cleaner:latest
To see a complete list of options gitlab-registry-cleaner --help
Gitlab Registry Cleaner accepts command options or ENV vars
| option | env var | type | required | default | desc |
|---|---|---|---|---|---|
| --api-url | TEXT | GRC_API_V4_URL, CI_API_V4_URL | * | Gitlab API Url (e.g. https://example.com:3000/api/v4) | |
| --token | TEXT | GRC_TOKEN, CI_JOB_TOKEN | * | Gitlab API Token | |
| --project-id | INT | GRC_PROJECT_ID, CI_PROJECT_ID | * | Gitlab Project ID | |
| --repository-name | REGEX | GRC_REPOSITORY_NAME | .* | Gitlab Registry Repository Name | |
| --tag-name | REGEX | GRC_TAG_NAME | .* | Tag names to delete | |
| --keep-n | INT | GRC_KEEP_N | 0 | Keep last N tags | |
| --older-than | TEXT | GRC_OLDER_THAN | Delete tags older than (e.g. 1h) | ||
| --dry-run | BOOL | False | Log what would do without doing it |
Content type
Image
Digest
Size
30 MB
Last updated
about 6 years ago
docker pull ovalmoney/gitlab-registry-cleaner