Mark images as latest during release pipeline.

PiperOrigin-RevId: 666136263
This commit is contained in:
Etienne Perot
2024-08-21 19:32:41 -07:00
committed by gVisor bot
parent 316e51d120
commit 7b9bc38345
2 changed files with 12 additions and 4 deletions
+2 -2
View File
@@ -23,14 +23,14 @@ steps:
label: ":ship: Push all images (x86_64)"
if: build.branch == "master" && build.tag == null
commands:
- make ARCH=x86_64 push-all-images
- make ARCH=x86_64 DOCKER_PUSH_AS_LATEST=true push-all-images
agents:
arch: "amd64"
- <<: *common
label: ":ship: Push all images (aarch64)"
if: build.branch == "master" && build.tag == null
commands:
- make ARCH=aarch64 push-all-images
- make ARCH=aarch64 DOCKER_PUSH_AS_LATEST=true push-all-images
agents:
arch: "arm64"
- <<: *common
+10 -2
View File
@@ -128,7 +128,7 @@ $(foreach image, $(ALL_IMAGES), $(eval $(call tag_expand_rule,$(image))))
local_tag = \
docker tag $(call remote_image,$(1)):$(call tag,$(1)) $(call local_image,$(1)):$(call tag,$(1)) >&2
latest_tag = \
docker tag $(call local_image,$(1)):$(call tag,$(1)) $(call local_image,$(1)) >&2
docker tag $(call local_image,$(1)):$(call tag,$(1)) $(call local_image,$(1)):latest >&2
tag-%: ## Tag a local image.
@$(call header,TAG $*)
@$(call local_tag,$*) && $(call latest_tag,$*)
@@ -181,9 +181,17 @@ test-%: register-cross ## Build an image locally if the remote doesn't exist.
# push pushes the remote image, after validating that the tag doesn't exist
# yet. Note that this generic rule will match the fully-expanded remote image
# tag.
# If DOCKER_PUSH_AS_LATEST is set to true, this also marks this image as being
# the latest one on the remote repository.
DOCKER_PUSH_AS_LATEST ?= false
push-%:
$(call image_manifest,$*) >&2 || \
( $(call rebuild,$*) && docker image push $(call remote_image,$*):$(call tag,$*) >&2 )
( $(call rebuild,$*) && \
docker image push $(call remote_image,$*):$(call tag,$*) >&2 && \
( test $(DOCKER_PUSH_AS_LATEST) '!=' true || \
docker image push $(call remote_image,$*):latest >&2 \
) \
)
# register-cross registers the necessary qemu binaries for cross-compilation.
# This may be used by any target that may execute containers that are not the