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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Atlantis Docker tag #15

Merged
merged 3 commits into from Oct 21, 2021

Conversation

7onn
Copy link
Contributor

@7onn 7onn commented Oct 19, 2021

What do you expect to happen?
I think it would be nice if this project mirrored the Atlantis releases.

Why?
Because this way, any update in the Atlantis version would provide the same tag for this Infracost "plugin"

Sorry I didn't open an Issue first. I saw this one wondering about versioning the plugin itself but it also made sense to me just mirroring the Atlantis. Plus my request seemed trivial to implement and I'm ready to face denial if my suggestion didn't match the expectations 馃し馃徏

Signed-off-by: Tom M G <devbytom@gmail.com>
@CLAassistant
Copy link

CLAassistant commented Oct 19, 2021

CLA assistant check
All committers have signed the CLA.

@7onn
Copy link
Contributor Author

7onn commented Oct 19, 2021

@alikhajeh1

@aliscott
Copy link
Member

Thanks @7onn.

I wonder if we should tag in the following format? :<infracost-version>-<atlantis-version>, e.g.:

infracost/infracost-atlantis:latest-atlantis0.17.2

This is what I've seen with other docker images that also tag based on the base image, e.g. the redis image with alpine.

What do you think?

@7onn
Copy link
Contributor Author

7onn commented Oct 20, 2021

@aliscott It seems super reasonable.

But currently, there are no releases for infracost/infracost-atlantis 馃 Only a workflow that triggers at every push to the main branch.

Do you mean the <infracost-version> to be the commit hash or a static latest? Because otherwise, I can add a workflow for handling the releases of it (and only push the docker release tag at this newest workflow while the latest keeps being pushed by the main branch HEAD). Then we would output something like v0.1.0-atlantisv0.17.2.

@aliscott
Copy link
Member

Do you mean the to be the commit hash or a static latest?

I think a static latest at the moment is good. Then in the future I think we can add tags for specific Infracost CLI versions, e.g. 0.9.11-atlantis0.17.2. I don't think we need specific tags for the versions of this integration, so think tagging based on Infracost CLI version and atlantis version is good enough. What do you think?

Signed-off-by: Tom M G <devbytom@gmail.com>
@7onn
Copy link
Contributor Author

7onn commented Oct 20, 2021

I think a static latest at the moment is good.

Of course 馃う馃徏 I did miss the fact that the Dockerfile currently pulls the latest Infracost version.

Done: 6972d03

@aliscott
Copy link
Member

Thanks @7onn, I'd consider removing the v prefix as well. I think we probably want to make that change in the main Infracost repo as well going forward, the standard (from the other images I've checked) seems to be to drop the v in the Docker tag.

@7onn
Copy link
Contributor Author

7onn commented Oct 21, 2021

Thanks @7onn, I'd consider removing the v prefix as well. I think we probably want to make that change in the main Infracost repo as well going forward, the standard (from the other images I've checked) seems to be to drop the v in the Docker tag.

If you mean this v prefix, then I guess there's no problem because the regex would match any version number with or without it.

You may just change it in Dockerfile and the pattern will be considered by the create-release workflow.

@aliscott
Copy link
Member

then I guess there's no problem because the regex would match any version number with or without it.

The runatlantis/atlantis image tags all have the v prefix, so we can't update the Dockerfile to remove this.

Most docker images I see don't use this prefix, so I was wondering if we should change to grep -oE '[0-9]+.[0-9]+.[0-9]+' to always exclude the v so this gets tagged as latest-atlantis0.17.2

Signed-off-by: Tom M G <devbytom@gmail.com>
@7onn
Copy link
Contributor Author

7onn commented Oct 21, 2021

There we go: c3ed42d

Here's the expected version output:

$ ATLANTIS_TAG=latest-atlantis$(cat Dockerfile | \
            grep -oE 'FROM.*atlantis.*' | \
            grep -oE '[0-9]+.[0-9]+.[0-9]+') 
&& echo $ATLANTIS_TAG
...
latest-atlantis0.17.2

@aliscott
Copy link
Member

Thanks @7onn! I've added a PR to Infracost CLI as well to update the Docker tagging there based on this discussion: infracost/infracost#1070

@aliscott aliscott merged commit 293613c into infracost:master Oct 21, 2021
@7onn 7onn deleted the 7onn/docker-push-atlantis-tag branch October 21, 2021 17:51
@aliscott
Copy link
Member

BOOM! 馃殌 works beautifully: https://hub.docker.com/layers/infracost/infracost-atlantis/latest-atlantis0.17.2/images/sha256-d6bd446de662d82612ebf1a60e00cf81ac77e1de6081f8d0bab783c70dfd20bd?context=explore

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.

None yet

3 participants