-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
atdima
committed
Nov 12, 2021
1 parent
2dcba29
commit 66bd2e5
Showing
3 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,37 @@ | ||
# Gitlab container registry cleaner | ||
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/traefik/traefik/blob/master/LICENSE.md) | ||
|
||
## About deploy | ||
Gitlab container registry cleaner | ||
--- | ||
|
||
https://semaphoreci.com/community/tutorials/how-to-deploy-a-go-web-application-with-docker | ||
## Features | ||
Periodic removes old images from GitLab container registry in all projects. | ||
|
||
## Run linter | ||
## Environment variables | ||
- PRODUCTION=false ( configure log format ) | ||
- THRESHOLD=3 ( images over threshold will be deleted automatically ) | ||
- BASE_API_URL=https://gitlab.com/api/v4 ( gitlab api endpoint ) | ||
- ACCESS_TOKEN=XXX ( gitlab access token, see https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token ) | ||
- CRON_TIME=01:11 ( time of day to run clean ) | ||
|
||
## Configuration file | ||
``` | ||
cp ./.env.example ./.env | ||
``` | ||
|
||
## Run clean command in docker | ||
``` | ||
docker run \ | ||
--name gitlab-registry-cleaner \ | ||
--env-file=./.env \ | ||
--env COMMAND_NAME=clean \ | ||
ataklychev/gitlab-registry-cleaner | ||
``` | ||
|
||
## Run cron command in docker | ||
``` | ||
make lint | ||
docker run \ | ||
--name gitlab-registry-cleaner \ | ||
--env-file=./.env \ | ||
--env COMMAND_NAME=cron \ | ||
ataklychev/gitlab-registry-cleaner | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters