Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parametrize over tag the docker image name definition #4932

Open
paolino opened this issue Jan 10, 2025 · 0 comments
Open

Parametrize over tag the docker image name definition #4932

paolino opened this issue Jan 10, 2025 · 0 comments
Assignees
Labels
CI CI related Improvement Mark a PR as an improvement, for auto-generated CHANGELOG

Comments

@paolino
Copy link
Collaborator

paolino commented Jan 10, 2025

Why

Logs from a pipeline push-to-docker step

2025-01-10 11:26:41 WEST	+ docker load -i artifacts/cardano-wallet-v2025-01-10-test-docker-image.tgz
2025-01-10 11:26:46 WEST	Loaded image: cardanofoundation/cardano-wallet:2025.1.10.1
2025-01-10 11:26:46 WEST	+ echo cardanofoundation/cardano-wallet:test
2025-01-10 11:26:46 WEST	cardanofoundation/cardano-wallet:test

In this case above a release pipeline was triggered by a not-master branch, which implies a (safe) pipeline test, which should push around "stuff" tagged as test, but the image loaded was not tagged as test.

The current docker build step creates image tags based solely on the cabal version of something. In the example above the cabal version was 2025.1.10.1 (the 1 is the test flag), so is the image name. As the wallet cabal version cannot have a test in it so we use arbitrary a 1 at the end of the version number.

OTOH we don't want the dockerhub repository to receive a 2025.1.10.1 image, because it would look like a legit image to download and use (that's why use test as a red flag for test artifacts).

What

Mess up the docker build script to use a TAG variable as the produced image tag and fix the pipeline to pass the TAG on image creation

Acceptance

The log above would become

2025-01-10 11:26:41 WEST	+ docker load -i artifacts/cardano-wallet-v2025-01-10-test-docker-image.tgz
2025-01-10 11:26:46 WEST	Loaded image: cardanofoundation/cardano-wallet:test
2025-01-10 11:26:46 WEST	+ echo cardanofoundation/cardano-wallet:test
2025-01-10 11:26:46 WEST	cardanofoundation/cardano-wallet:test
@paolino paolino added Improvement Mark a PR as an improvement, for auto-generated CHANGELOG CI CI related labels Jan 10, 2025
@paolino paolino self-assigned this Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI CI related Improvement Mark a PR as an improvement, for auto-generated CHANGELOG
Projects
None yet
Development

No branches or pull requests

1 participant