Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lpsm-dev/drprune
🤖 [Community Project] - Prune old images on GitHub and GitLab container registry
https://github.com/lpsm-dev/drprune
cleanup cleanup-script cli-app cli-deployment cli-tool devops devops-tools github github-registry gitlab gitlab-registry go-cli go-cobra hacktoberfest registry
Last synced: 28 days ago
JSON representation
🤖 [Community Project] - Prune old images on GitHub and GitLab container registry
- Host: GitHub
- URL: https://github.com/lpsm-dev/drprune
- Owner: lpsm-dev
- License: mit
- Created: 2022-01-09T15:40:06.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-08T16:58:38.000Z (10 months ago)
- Last Synced: 2024-10-01T15:07:58.582Z (about 1 month ago)
- Topics: cleanup, cleanup-script, cli-app, cli-deployment, cli-tool, devops, devops-tools, github, github-registry, gitlab, gitlab-registry, go-cli, go-cobra, hacktoberfest, registry
- Language: Go
- Homepage: https://github.com/lpmatos/drprune
- Size: 747 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
✨ Prune container images in a CLI way ✨
[![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)]()
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)]()
[![GitHub repo size](https://img.shields.io/github/repo-size/lpmatos/ghcr-prune)](https://github.com/lpmatos/ghcr-prune)---
A CLI tool that prune old images on GitHub (ghcr.io) registry and GitLab (registry.gitlab.com) registry
Getting Started |
Description |
Usage |
Installation |
Concepts |
Versioning---
If you want contribute on this project, first you need to make a **git clone**:
```bash
git clone --depth 1 https://github.com/ci-monk/drprune.git -b main
```This will give you access to the code on your **local machine**.
**Variables**
| Environment | Description |
|-------------- |------------------------------- |
| GH_TOKEN | GitHub API Token |
| GH_USERNAME | GitHub User/Organization Name |
| GH_CONTAINER | GitHub Container Name |
| GL_TOKEN | GitLab API Token |
| GL_NAMESPACE | GitLab Namespace |### CLI
**GitHub**
```bash
drprune gh images -t $GH_TOKEN -n -c
drprune gh insights -t $GH_TOKEN -n
```**GitLab**
```bash
drprune gl images -t $GL_TOKEN -ns
drprune gl insights -t $GL_TOKEN -ns
```### CI
**GitHub Actions**
```yaml
```
**GitLab CI**
```yaml
```
with `go`:
```bash
# if you cannot install directly, try following command,
# then input install command again
go get -u github.com/lpmatos/drprune/cmd/drprune# or
go get -v ./...
go run ./cmd/drprune/main.go --help
```with `brew`:
```bash
brew tap ci-monk/tools
brew install drprune
```### Cobra
Cobra is a CLI framework for Golang. Using it you can speed up your development and creating a powerful and modern CLI application. Cobra is built on a structure of commands, arguments and flags:
- Commands represent actions.
- Args are things.
- Flags are modifiers for those actions.The best applications will read like sentences when used. Users will know how to use the application because they will natively understand how to use it. This pattern is: `APPCLI VERB NOUN --ADJECTIVE` or `APPCLI COMMAND ARG --FLAG`.
#### Commands
Command is the central point of the application. Each interaction thar the application supports will be contained in a command. We can create commands with children commands and optionally run an `action`. In the example above, `server` is the command.
#### Flags
A flag is a way to modify the behavior of a command. Cobra supports fully POSIX-compliant flags as well the Go flag package. A Cobra command can define flags that persist through to children commands and flags that are only available to that command. In the example above, `port` is the flag.
- Create a Golang CLI application.
- Create a multistage Golang Dockerfile.
- Create a docker-compose file with waiting entrypoint.
- Setup a Golang Releaser publish pipeline using github actions.
- Understand how GiHub works with packages.
- Understand how GitLab works with packages.
- Handler operations in GitHub API to delete container images using a SDK.
- Handler operations in GitLab API to delete container images using a SDK.- https://github.com/pterm/pterm
- https://github.com/jedib0t/go-pretty
- https://github.com/charmbracelet/glamour
- https://github.com/charmbracelet/bubbles
- https://github.com/charmbracelet/bubbleteaTo check the change history, please access the [**CHANGELOG.md**](CHANGELOG.md) file.
The project is currently being updated! 👾
If my work has impacted your life in a positive way and you'd like to buy me a coffee (or a hundred), that'd be much appreciated!
Give me a ⭐️ if this project helped you!
Made with 💜 by [me](https://github.com/lpmatos) 👋 inspired on [readme-md-generator](https://github.com/kefranabg/readme-md-generator)