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: publish latest-master-build docker image #95444

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

rail
Copy link
Member

@rail rail commented Jan 18, 2023

Previously, our automation published latest docker images using latest-v2x.x-build tag. External automation that tracked the master branch would need to update the tag, when we change the version.

This PR adds an extra step to tag the master branch builds with latest-master-build docker tag.

Epic: none
Release note: None

Previously, our automation published latest docker images using
`latest-v2x.x-build` tag. External automation that tracked the master
branch would need to update the tag, when we change the version.

This PR adds an extra step to tag the master branch builds with
`latest-master-build` docker tag.

Epic: none
Release note: None
@rail rail added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-dev-inf A-ci Continuous Integration labels Jan 18, 2023
@rail rail requested review from jlinder and srosenberg January 18, 2023 17:12
@rail rail self-assigned this Jan 18, 2023
@rail rail requested a review from a team as a code owner January 18, 2023 17:12
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@@ -55,6 +55,10 @@ if [[ -n "${release_branch}" ]] ; then
log_into_gcloud
gcloud container images add-tag "${gcr_repository}:${build_name}" "${gcr_repository}:latest-${release_branch}-build"
fi
if [[ "$TC_BUILD_BRANCH" == "master" ]]; then
log_into_gcloud
gcloud container images add-tag "${gcr_repository}:${build_name}" "${gcr_repository}:latest-master-build"
Copy link
Member

Choose a reason for hiding this comment

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

Don't we also need to remove the label from the previous push? There should always be at most one image with this tag, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

AFAIK, this push replaces all previously published tags with the same name. This is the same logic we use for latest-v23.1-build tag.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Indeed. It's a property of container repositories that a given tag can be on only one image in a repository at a time.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! I think I was regressing to this incantation which we had to use for updating the "latest" label after a new AMI was created,

gcloud compute images remove-labels $IMAGE --labels="latest"`

@rail
Copy link
Member Author

rail commented Jan 18, 2023

bors r=jlinder

@craig
Copy link
Contributor

craig bot commented Jan 18, 2023

Build succeeded:

@craig craig bot merged commit 1d2ba22 into cockroachdb:master Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ci Continuous Integration C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-dev-inf
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants