@@ -74,6 +74,10 @@ load-all-test-images: ## Load all test images.
7474load-all-test-images : $(patsubst % ,load-% ,$(TEST_IMAGES ) )
7575.PHONY : load-all-test-images
7676
77+ test-all-test-images : # # Test all test images.
78+ test-all-test-images : $(patsubst % ,test-% ,$(TEST_IMAGES ) )
79+ .PHONY : test-all-test-images
80+
7781push-all-images : # # Push all images.
7882push-all-images : $(patsubst % ,push-% ,$(ALL_IMAGES ) )
7983.PHONY : push-all-images
@@ -129,10 +133,13 @@ tag-%: ## Tag a local image.
129133 @$(call header,TAG $* )
130134 @$(call local_tag,$* ) && $(call latest_tag,$* )
131135
136+ image_manifest = \
137+ docker run --rm gcr.io/go-containerregistry/crane manifest $(call remote_image,$(1 ) ) :$(call tag,$(1 ) )
138+
132139# pull forces the image to be pulled.
133140pull = \
134141 $(call header,PULL $(1 ) ) && \
135- docker pull -q $(DOCKER_PLATFORM_ARGS ) $(call remote_image,$(1 ) ) :$(call tag,$(1 ) ) >&2 && \
142+ docker pull $(DOCKER_PLATFORM_ARGS ) $(call remote_image,$(1 ) ) :$(call tag,$(1 ) ) >&2 && \
136143 $(call local_tag,$(1 ) ) && \
137144 $(call latest_tag,$(1 ) )
138145pull-% : register-cross # # Force a repull of the image.
@@ -163,11 +170,14 @@ rebuild-%: register-cross ## Force rebuild an image locally.
163170load-% : register-cross # # Pull or build an image locally.
164171 @ ($( call pull,$* ) ) || ($( call rebuild,$* ) )
165172
173+ test-% : register-cross # # Build an image locally if the remote doesn't exist.
174+ @ ($( call image_manifest,$* ) ) >&2 || ($( call rebuild,$* ) )
175+
166176# push pushes the remote image, after validating that the tag doesn't exist
167177# yet. Note that this generic rule will match the fully-expanded remote image
168178# tag.
169179push-% :
170- gcloud artifacts docker images describe $(call remote_image, $* ) : $( call tag ,$* ) >&2 || \
180+ $(call image_manifest ,$* ) >&2 || \
171181 ( $( call rebuild,$* ) && docker image push $( call remote_image,$* ) :$( call tag,$* ) >&2 )
172182
173183# register-cross registers the necessary qemu binaries for cross-compilation.
0 commit comments