Skip to content

Commit 0f9fbbd

Browse files
committed
Package Updates and Documentation Improvements
1 parent bd9b15d commit 0f9fbbd

File tree

9 files changed

+205
-236
lines changed

9 files changed

+205
-236
lines changed

.github/workflows/lint.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- uses: actions/setup-python@v5
1515
with:
16-
python-version: "3.12"
17-
- run: pip install black ruff mypy types-requests
18-
- run: ruff .
19-
- run: black --check .
16+
python-version: "3.13"
17+
- run: pip install ruff mypy types-requests
18+
- run: ruff check .
2019
- run: mypy .

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fetch-depth: 0
1414
- uses: actions/setup-python@v5
1515
with:
16-
python-version: "3.12"
16+
python-version: "3.13"
1717
- run: |
1818
pip install poetry
1919
poetry self add "poetry-dynamic-versioning[plugin]"

.github/workflows/retag.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ jobs:
3131
steps:
3232
- uses: actions/setup-python@v5
3333
with:
34-
python-version: "3.12"
34+
python-version: "3.13"
3535
- run: pip install container-tagbot
3636
- run: tagbot --username="${{ inputs.username }}" --password="${{ secrets.password }}" --source="${{ inputs.source }}" --tags="${{ inputs.tags }}"

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ ipython_config.py
106106
#pdm.lock
107107
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108108
# in version control.
109-
# https://pdm.fming.dev/#use-with-ide
109+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110110
.pdm.toml
111+
.pdm-python
112+
.pdm-build/
111113

112114
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113115
__pypackages__/
@@ -165,8 +167,7 @@ cython_debug/
165167
.LSOverride
166168

167169
# Icon must end with two \r
168-
Icon
169-
170+
Icon
170171

171172
# Thumbnails
172173
._*

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Bink
3+
Copyright (c) 2024 Chris Pressland
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
# Tagbot
22

3-
Tagbot retags OCI Container Images without needing a full Docker Pull / Docker Push workflow by working directly with the registry API.
3+
Tagbot is a tool for retagging OCI Container Images directly using the registry API, eliminating the need for a full Docker Pull/Push workflow.
4+
5+
## Features
6+
7+
- Add multiple tags to an image without pulling or pushing.
8+
- Efficient and API-driven.
49

510
## Usage
611

712
### Local Usage
813

14+
To use Tagbot locally, run:
15+
16+
```shell
17+
tagbot \
18+
--username <your-username> \
19+
--password <your-password> \
20+
--source <registry>/<image>:<tag> \
21+
--tags <tag1>,<tag2>
22+
```
23+
24+
#### Example:
925
```shell
1026
tagbot \
1127
--username example \
@@ -14,7 +30,11 @@ tagbot \
1430
--tags v1.0.0,1.0.0
1531
```
1632

17-
This would add an additional tag of `v1.0.0` to `example.azurecr.io/debian:latest`. The container image can then be pulled with either `example.azurecr.io/debian:latest`, `example.azurecr.io/debian:v1.0.0`, or `example.azurecr.io/debian:1.0.0`
33+
This command adds the tags `v1.0.0` and `1.0.0` to `example.azurecr.io/debian:latest`. The image can then be pulled using any of the following tags:
34+
35+
- `example.azurecr.io/debian:latest`
36+
- `example.azurecr.io/debian:v1.0.0`
37+
- `example.azurecr.io/debian:1.0.0`
1838

1939
### GitHub Actions Usage
2040

@@ -27,22 +47,34 @@ on:
2747

2848
jobs:
2949
release:
30-
uses: binkhq/tagbot/.github/workflows/retag.yaml@master
50+
uses: cpressland/tagbot/.github/workflows/retag.yaml@master
3151
with:
3252
username: example
3353
source: example.azurecr.io/${{ github.event.repository.name }}:${{ github.ref_name }}
3454
tags: ${{ matrix.environment }}-v1.0.0,${{ matrix.environment }}
35-
envirnment: ${{ matrix.environment }}
55+
environment: ${{ matrix.environment }}
3656
secrets:
37-
password: ${{ secrets.ACR_BINKCORE_PASSWORD }}
57+
password: ${{ secrets.ACR_PASSWORD }}
3858
strategy:
3959
matrix:
4060
environment: [staging, production]
4161
```
4262
4363
## FAQ
4464
45-
* Whats going on with `ghcr.io/binkhq/tagbot`?
46-
- This still exists, but is formally deprecated and will no longer recieve updates or support
47-
* Are Registries other than Azure Container Registry supported?
48-
- Azure Container Registry is the only officially supported Registry, but other simple registries like Docker Hub are expected to work just fine.
65+
- **Q**: Are registries other than Azure Container Registry supported?<br>
66+
**A**: Azure Container Registry is the only officially supported registry. However, other registries, such as Docker Hub, Amazon ECR, and Google Container Registry, are likely to work if they conform to standard OCI APIs.
67+
- **Q**: Does Tagbot require admin-level credentials for the registry?<br>
68+
**A**: No, it only requires permissions to read and write tags for the specified images.
69+
- **Q**: Can I retag multiple images in a single command?<br>
70+
**A**: No, Tagbot currently supports retagging one image at a time. Use a script or automation tool to process multiple images.
71+
- **Q**: Are there any size limitations for the images being retagged?<br>
72+
**A**: No, since Tagbot operates at the registry level, the image size is irrelevant.
73+
- **Q**: Is Tagbot secure to use with my credentials?<br>
74+
**A**: Tagbot does not store your credentials and only uses them for the duration of the operation. For additional security, use environment variables or secret management tools.
75+
- **Q**: Can I remove a tag from an image using Tagbot?<br>
76+
**A**: No, Tagbot only supports adding new tags. To remove tags, use your registry's management tools.
77+
- **Q**: What happens if the specified tag already exists?<br>
78+
**A**: If the tag already exists, Tagbot will reassign it to the source image.
79+
- **Q**: Is there a dry-run mode to test without making changes?<br>
80+
**A**: Currently, Tagbot does not support a dry-run mode.

container_tagbot/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ def tagbot(username: str, password: str, source: str, new_tags: str) -> None:
1111
"""Tag a container image in a registry.
1212
1313
Args:
14-
----
1514
username (str): Username for Container Registry
1615
password (str): Password for Container Registry
1716
source (str): Source Container Image and Tag
1817
new_tags (str): New Container Image Tags, comma seperated
1918
2019
Returns:
21-
-------
2220
None
21+
2322
"""
2423
registry, image, tag = re.split("[:/]", source)
2524

0 commit comments

Comments
 (0)