gitlab-registry-cleanup

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 2 Imported by: 0

README

gitlab-registry-cleanup

A small utility for cleaning up Gitlab container registry image tags, inspired by the built in registry cleanup policies built into Gitlab.

Why?

When attempting to implement Cleanup Policies, we found configuration options to be limited, with only one policy per repository currently possible. This application implements the same functionality, however allows many policies to be specified.

Usage

A tool for cleaning up gitlab registries

Usage:
  gitlab-registry-cleanup [command]

Available Commands:
  execute     Executes cleanup
  help        Help about any command

Flags:
      --config string   config file (default "config.yml")
      --debug           specifies logging level should be set to debug
  -h, --help            help for gitlab-registry-cleanup

Commands

execute

Executes cleanup process

Flags
  • --dry-run: Specifies execution should be ran in dry run mode. Tag deletions will not occur

Config

Application config is specified with a yaml configuration file, with an example below:

access_token: myaccesstoken
url: https://gitlab.privateinstance.com
repositories:
- project: 123
  image: myproject/somerepository
  filter:
    include: .*
    exclude: v.+
    keep: 5
    age: 30
  • access_token: Private access token with api read/write scope
  • url: Gitlab instance URL
  • repositories array
    • project: Project ID to target
    • image: Path of repository/image
    • filter: object
      • include: (Optional) Regex specifying image tags to include
      • exclude: (Optional) Regex specifying image tags to exclude
      • keep: (Optional) Specifies amount of tags to keep
      • age: (Optional) Specifies amount of days to keep tags

Docker

We recommend using Docker for executing this utility. Example usage can be found below:

docker run -v "${PWD}/config.yml:/config.yml" --rm -it ukfast/gitlab-registry-cleanup execute --config /config.yml

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL