Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devs-group/gitlab-registry-cleaner
Tiny container which can be used to remove images from gitlab registry.
https://github.com/devs-group/gitlab-registry-cleaner
Last synced: about 1 month ago
JSON representation
Tiny container which can be used to remove images from gitlab registry.
- Host: GitHub
- URL: https://github.com/devs-group/gitlab-registry-cleaner
- Owner: devs-group
- Created: 2020-10-23T09:02:07.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-23T11:04:37.000Z (over 4 years ago)
- Last Synced: 2023-03-08T11:12:47.934Z (almost 2 years ago)
- Language: Go
- Size: 1.95 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gitlab Registry Cleaner
Gitlab Registry Cleaner is a tiny container which can be used to remove images from gitlab registry.
## Usage
1. Create gitlab access token. Read how to [here](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token).
1. Run container in your `.gitlab-ci.yml`
```sh
docker run \
&& -e ACCESS_TOKEN='' \
&& -e PROJECT_ID=$CI_PROJECT_ID \
&& -e IMAGE_TAG=$CI_BUILD_REF_NAME \
&& -e IMAGE_LOCATION=$GITLAB_REGISTRY/$CI_PROJECT_PATH/ \
&& devsgroup/gitlab-registry-cleaner:latest
```E.g.
```yml
delete_frontend_image:
stage: clean
script:
- |
docker run \
-e ACCESS_TOKEN=$GITLAB_ACCESS_TOKEN \
-e PROJECT_ID=$CI_PROJECT_ID \
-e IMAGE_TAG=$CI_BUILD_REF_NAME \
-e IMAGE_LOCATION=$GITLAB_REGISTRY/$CI_PROJECT_PATH/web_frontend \
devsgroup/gitlab-registry-cleaner:latest
only:
- branches
except:
- master
```## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.
## License
[MIT](https://choosealicense.com/licenses/mit/)