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

fix(docker): Set version based on release tag, revert gorelease signing #3051

Merged
merged 11 commits into from Jan 26, 2023

Conversation

nitrocode
Copy link
Member

@nitrocode nitrocode commented Jan 26, 2023

what

  • Set version based on github release tag in docker
  • Missing commit from previous pr to disable signing
  • Used logger instead of fmt
  • Quoted strings in Dockerfile
  • add workflow_dispatch to release action
  • goreleaser's github config is omitted

why

  • Set version in docker container otherwise it will default to dev instead of the tag passed to it
  • Disable signing since there is a missing GPG key (added TODO)
  • Using logger so log entry only shows up as a debug message
  • Dockerfile quotes to resolve hadolint issues
  • release action can now be run manually to correct a broken tag (like the current one) without having to create a brand new release
  • goreleaser now implicitly grabs the github info so if a user forks the repo, not only is there image built and uploaded on their fork, but if they created custom releases, goreleaser would upload those successfully to their fork as well

notes

  • Previously added rlcp to calm goreleaser deprecations but we use a very old version of goreleaser so rlcp is not even understood. Filed a separate ticket for this. Upgrade gorelease to 1.x #3052
  • Tried to use the docker meta action to swap between dev and the release tag but it's a bit difficult since not all of the code uses the meta action yet. This will have to be done in another ticket. Filed a separate ticket for this. Sign all goreleaser builds #3053

tests

Testing...

  • I have tested my changes on my fork

on pr merge action run and notable expected build-args and tags from Build and push (for dev)

/usr/bin/docker buildx build \
  --build-arg ATLANTIS_BASE_TAG_TYPE=alpine \
  --build-arg ATLANTIS_VERSION=dev \
  --build-arg ATLANTIS_COMMIT=5dd99934118ec370aaa51ce63bae7ac722177231 \
  --build-arg ATLANTIS_DATE=2023-01-26T03:02:17.318Z \
  --tag ghcr.io/nitrocode/atlantis:dev \
  --tag ghcr.io/nitrocode/atlantis:dev-alpine \
  --push .

on pre-release action run and notable expected build-args and tags from Build and push (for pre-release)

/usr/bin/docker buildx build \
  --build-arg ATLANTIS_BASE_TAG_TYPE=alpine \
  --build-arg ATLANTIS_VERSION=v0.23.0-pre.20230125 \
  --build-arg ATLANTIS_COMMIT=5dd99934118ec370aaa51ce63bae7ac722177231 \
  --build-arg ATLANTIS_DATE=2023-01-26T03:08:27.628Z \
  --tag ghcr.io/nitrocode/atlantis:v0.23.0-pre.20230125 \
  --tag ghcr.io/nitrocode/atlantis:v0.23.0-pre.20230125-alpine \
  --tag ghcr.io/nitrocode/atlantis:prerelease-latest \
  --tag ghcr.io/nitrocode/atlantis:prerelease-latest-alpine \
  --push .

references

2023-01-25_21-40

@nitrocode nitrocode requested a review from a team as a code owner January 26, 2023 02:05
@github-actions github-actions bot added build Relating to how we build Atlantis github-actions go Pull requests that update Go code labels Jan 26, 2023
@nitrocode nitrocode added this to the v0.23.0 milestone Jan 26, 2023
@nitrocode nitrocode changed the title fix(docker): Set version based on github release tag fix(docker): Set version based on release tag, revert gorelease signing Jan 26, 2023
@nitrocode nitrocode enabled auto-merge (squash) January 26, 2023 03:41
@nitrocode nitrocode mentioned this pull request Jan 26, 2023
1 task
@nitrocode nitrocode merged commit 40f1e95 into main Jan 26, 2023
@nitrocode nitrocode deleted the version-based-on-tag-docker branch January 26, 2023 03:46
@nitrocode
Copy link
Member Author

After cutting the release, we can see the new version propagate to the command line.

✗ docker pull ghcr.io/runatlantis/atlantis:v0.23.0-pre.20230125
✗ docker run --rm -it ghcr.io/runatlantis/atlantis:v0.23.0-pre.20230125 version
atlantis v0.23.0-pre.20230125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Relating to how we build Atlantis github-actions go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate releases without a manual PR prior to release
2 participants