go install github.com/kilianpaquier/gitlab-storage-cleaner/cmd/gitlab-storage-cleaner@latest
Gitlab CICD
A potential usage can be to schedule a job once a while with given .gitlab-ci.yml.
Commands
gitlab-storage-cleaner stands here to help in a small gitlab
continuous integration's step to clean all old or outdated storage of a given
or even multiple projects.
Usage:
gitlab-storage-cleaner [command]
Available Commands:
artifacts Clean artifacts of provided project(s)' gitlab storage
completion Generate the autocompletion script for the specified shell
help Help about any command
version Shows current gitlab-storage-cleaner version
Flags:
-h, --help help for gitlab-storage-cleaner
-l, --log-level string set logging level
Use "gitlab-storage-cleaner [command] --help" for more information about a command.
Artifacts
Clean artifacts of provided project(s)' gitlab storage
Usage:
gitlab-storage-cleaner artifacts [flags]
Flags:
--dry-run truthy if run must not delete jobs' artifacts but only list matched projects
-h, --help help for artifacts
--paths strings list of valid regexps to match project path (with namespace)
--server string gitlab server host
--threshold-duration duration threshold duration (positive) where, from now, jobs artifacts expiration is after will be cleaned up (default 168h0m0s)
--threshold-size uint threshold size (in bytes) where jobs artifacts size sum is bigger will be cleaned up (default 1000000)
--token string gitlab read/write token with maintainer rights to delete artifacts
Global Flags:
-l, --log-level string set logging level