This Projects aims to create a Small Docker Container that can be run as part of a gitlab-ci Pipeline to trigger a Docker Registry cleanup.
Install glide follwing the instructions here https://github.com/Masterminds/glide#install
glide install
For the development setup, you have to connect your local copy to the Golang Dependency System.
In $GOPATH/src/github.com/phaus create a Softlink to your local copy (e.g. ln -s /Users/philipp/GIT/go/gitlab-claner).
Install direnv. Copy and modify .envrc.example to .envrc matching to your gitlab project configuration.
Run direnv allow . in your current folder. Your ENV Variables should now be injected, everytime you enter that folder.
Install jq. Run the Script scripts/get.sh to test your setup.
Wer möchte kann unter gitlab-ci gerne mal etwas testen:
-
Create a new private access token: https://gitlab.com/profile/personal_access_tokens (Access to
api) -
Add this Token as
PRIVATE_ACCESS_TOKENas a CI/CD Variable. -
Add this snippet to your
.gitlab-ci.ymlfile:
cleaner:
stage: test
image: phaus/gitlab-cleaner
script:
- cleaner test
- cleaner listAt the moment, it just parses the Registry API. No changes are made.