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

chore: only tag/push latest Docker for latest semantic tag #1182

Merged
merged 3 commits into from
Nov 30, 2022

Conversation

markphelps
Copy link
Collaborator

This should fix the issue where creating a backport release was incorrectly also tagging the image as latest and pushing to our Docker registries

This removes the tagging of latest from goreleaser workflow and instead tags and pushes the image only if it is actually the most recent semantic release.

I tested this locally by writing a little script:

# test.sh

if [[ $(git tag -l --sort=-version:refname | head -n 1) == $TAG ]]; then
    echo "MATCH"
else
    echo "NO MATCH"
fi
$ ./test.sh
NO MATCH

$ TAG=v1.15.1 ./test.sh
NO MATCH

$ TAG=v1.15.2 ./test.sh
MATCH

@markphelps markphelps requested a review from a team as a code owner November 29, 2022 18:24
- name_template: "{{ if .IsNightly }}flipt/flipt:{{ incpatch .Version }}-nightly{{ else }}flipt/flipt:{{ .Tag }}{{ end }}"
image_templates:
- "{{ if .IsNightly }}flipt/flipt:{{ incpatch .Version }}-nightly-amd64{{ else }}flipt/flipt:{{ .Tag }}-amd64{{ end }}"
- "{{ if .IsNightly }}flipt/flipt:{{ incpatch .Version }}-nightly-arm64{{ else }}flipt/flipt:{{ .Tag }}-arm64{{ end }}"
- name_template: "{{ if .IsNightly }}markphelps/flipt:nightly{{ else }}markphelps/flipt:latest{{ end }}" # TODO: deprecate
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

gah, this does break the nightly tag tho..

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I fixed it by breaking out nightly into its own .goreleaser.nightly.yml and using the includes functionality of goreleaser

@pull-request-size pull-request-size bot added size/M and removed size/S labels Nov 29, 2022
@GeorgeMac
Copy link
Member

I've been seeing this block on cockroach a lot lately. This is an attempt to see if waiting for SQL helps: #1183

Copy link
Member

@GeorgeMac GeorgeMac left a comment

Choose a reason for hiding this comment

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

Nice.

@markphelps markphelps merged commit 5e3c257 into main Nov 30, 2022
@markphelps markphelps deleted the fix-latest-docker-release branch November 30, 2022 14:19
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