feat: enhance Docker image tagging and add publication functionality

Signed-off-by: d9pouces <github@19pouces.net>
This commit is contained in:
d9pouces
2026-09-04 21:58:28 +02:00
parent 26fcdd08e4
commit 22367224d7
4 changed files with 172 additions and 7 deletions
+35 -3
View File
@@ -1,5 +1,5 @@
[tox]
env_list = py313,py314,coverage
env_list = py313,py314,coverage,packaging,publish,module-python
isolated_build = true
requires =
tox>=4
@@ -26,6 +26,38 @@ commands =
python3 -m coverage xml -o .tox/coverage.xml --ignore
python3 -m coverage report -m --fail-under=94 --ignore --skip-covered
[testenv:packaging]
package = skip
change_dir = {tox_root}
allowlist_externals =
docker
dependency_groups = dev
description =
Generate the docker images for the different platform
depends =
update
commands =
python3 -m id_tools build docker --platform linux/amd64,linux/arm64/v8
[testenv:publish]
package = skip
change_dir = {tox_root}
dependency_groups = dev
description =
Build and publish the image to Docker Hub.
The version is taken from the pyproject.toml file.
Make sure that you have the rights to upload the image to Docker Hub.
commands =
python3 -m uv sync --all-groups --active
python3 -m id_tools build docker --platform linux/amd64,linux/arm64/v8 --push
python3 -m id_tools publication sign-docker
docker =
passenv =
COSIGN_PASSWORD
COSIGN_PRIVATE_KEY
DOCKER_HUB_LOGIN
DOCKER_HUB_TOKEN
[docker:pypi-repo]
dockerfile = {tox_root}/tests/dockerfiles/repos/pypi-repo.Dockerfile
expose =
@@ -45,5 +77,5 @@ docker =
allowlist_externals =
docker
commands =
python3 -m id_tools test render-config tests/configs/Python.yaml.tmpl {toxworkdir}/configs/Python.yaml
docker buildx build --platform linux/amd64 --add-host=host.docker.internal:host-gateway --build-context generated-config={toxworkdir}/configs -f tests/dockerfiles/Python.Dockerfile -t id-configurator-python .
python3 -m id_tools test render-config {tox_root}/tests/configs/Python.yaml.tmpl {env_dir}/configs/Python.yaml
docker buildx build --platform linux/amd64 --add-host=host.docker.internal:host-gateway --build-context generated-config={env_dir}/configs -f {tox_root}/tests/dockerfiles/Python.Dockerfile -t id-configurator-python .