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

Introduce stable tag on containers #489

Merged
merged 2 commits into from
Oct 17, 2024
Merged

Conversation

perfectra1n
Copy link

Closes #488

Comment on lines 246 to 255
# If the ref is a tag, also tag the image as stable as this is part of a 'release'
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
-t ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:stable \
$(printf '${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)

docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
-t ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:stable \
$(printf '${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You did quite a bit of bash magic in here. 😎

Does this also handle the case where I push a beta version such as v0.90.7-beta? In this case we shouldn't tag it as stable; the stable tag should remain to v0.90.4 until say v0.90.8 comes along.

Copy link
Author

@perfectra1n perfectra1n Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah Bash is not my favorite, but it's a power I have lol - and no, that's a good point. I was just catching if there was a new tag pushed. I'm assuming I would just have to catch if there is a - in the string of the tag that is pushed, to assume that it's not a stable build?

e.g. don't mark these as stable:
v1.0.0-alpha
v2.24.1-beta
etc...

Copy link

@eliandoran eliandoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@eliandoran eliandoran merged commit e29d600 into develop Oct 17, 2024
1 check passed
@eliandoran eliandoran deleted the add-stable-tag-to-containers branch October 17, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Feature request) Introduce stable tag on docker hub
2 participants