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

ci: pass version to Docker image #19

Open
wants to merge 1 commit into
base: flatcar-master
Choose a base branch
from
Open

Conversation

tormath1
Copy link
Contributor

@tormath1 tormath1 commented Mar 9, 2022

Latest release gave the following:

podman run --rm ghcr.io/flatcar-linux/ct -version
ct

Instead of:

podman run --rm ct -version
ct v0.9.3

I think in the CI, we can't rely on Git to get the tag:

#10 2.710 fatal: No annotated tags can describe '3d9d6367d07de0323055e7d1536040e03b43c963'.
#10 2.710 However, there were unannotated tags: try --tags.
#10 2.713 fatal: No annotated tags can describe '3d9d6367d07de0323055e7d1536040e03b43c963'.
#10 2.713 However, there were unannotated tags: try --tags.
#10 2.716 fatal: No annotated tags can describe '3d9d6367d07de0323055e7d1536040e03b43c963'.
#10 2.716 However, there were unannotated tags: try --tags.
#10 2.719 fatal: No annotated tags can describe '3d9d6367d07de0323055e7d1536040e03b43c963'.
#10 2.719 However, there were unannotated tags: try --tags.
#10 2.801 fatal: No annotated tags can describe '3d9d6367d07de0323055e7d1536040e03b43c963'.
#10 2.801 However, there were unannotated tags: try --tags.

So let's try to explicitly pass the tag.

@tormath1 tormath1 requested a review from jepio March 9, 2022 16:11
@tormath1 tormath1 self-assigned this Mar 9, 2022
@@ -47,3 +47,5 @@ jobs:
platforms: linux/amd64,linux/arm64/v8
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args:
- VERSION=${{ steps.meta.outputs.tags }}
Copy link
Member

@jepio jepio Mar 9, 2022

Choose a reason for hiding this comment

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

unfortunately this will expand do something like: ghcr.io/flatcar-linux/ct:v0.9.3 ghcr.io/flatcar-linux/ct:latest

@jepio
Copy link
Member

jepio commented Mar 9, 2022

What about this: https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches

Signed-off-by: Mathieu Tortuyaux <[email protected]>
@tormath1
Copy link
Contributor Author

tormath1 commented Mar 9, 2022

What about this: https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches

@jepio thanks - it almost works. On my fork, I keep hitting some issues:

podman run --rm ghcr.io/tormath1/ct:v0.9.4 -version
ct v0.9.3-1
podman run --rm ghcr.io/tormath1/ct:v0.9.5 -version
ct v0.9.4-1-g9d82171

I'll have a look tomorrow.

@jepio
Copy link
Member

jepio commented May 30, 2022

@tormath1 were you ever able to figure it out? If not, might still be better to merge this than to not have versions :)

@tormath1
Copy link
Contributor Author

@jepio thanks for the heads-up. I gave another try, still hitting the inconsistency but the change looks good to me according to the documentation.
Let's merge this and iterate on it - I'm guessing I got some inconsistency because I can't really be iso-prod and using a fork might messing up the version injection.

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.

2 participants