From 117cbda4870c988f1e98957dd328970bba1926c4 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Thu, 27 Feb 2020 06:00:03 -0800 Subject: [PATCH] Image Promoter: Allows images to be pushed immediately after being built In the current version, due to how make works, when building all the conformance images (make all-push WHAT=all-conformance), ALL the images are being built first before being pushed. This PR will allow images to be built and pushed immediately afterwards, so the first images that have been succesfully built are already pushed and promotable, even if the the task failed on the last image, or it timed out. --- test/images/Makefile | 5 ++++- test/images/cloudbuild.yaml | 2 +- test/images/image-util.sh | 8 ++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/test/images/Makefile b/test/images/Makefile index 7376c2a9fc3..b588d739aca 100644 --- a/test/images/Makefile +++ b/test/images/Makefile @@ -37,4 +37,7 @@ all-container: all-push: all-container ./image-util.sh push $(WHAT) -.PHONY: all all-push all-container +all-build-and-push: + ./image-util.sh build_and_push ${WHAT} + +.PHONY: all all-build-and-push all-push all-container diff --git a/test/images/cloudbuild.yaml b/test/images/cloudbuild.yaml index c1217938d55..2912b934601 100644 --- a/test/images/cloudbuild.yaml +++ b/test/images/cloudbuild.yaml @@ -19,7 +19,7 @@ steps: - REGISTRY=gcr.io/k8s-staging-e2e-test-images # TODO(claudiub): Readd the REMOTE_DOCKER_URL_${os_version} to reenable the Windows test image building process. args: - - all-push + - all-build-and-push substitutions: # _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and # can be used as a substitution diff --git a/test/images/image-util.sh b/test/images/image-util.sh index 3c62ecd736e..b750449f963 100755 --- a/test/images/image-util.sh +++ b/test/images/image-util.sh @@ -237,6 +237,14 @@ push() { docker manifest push --purge "${REGISTRY}/${image}:${TAG}" } +# This function is for building AND pushing images. Useful if ${WHAT} is "all-conformance". +# This will allow images to be pushed immediately after they've been pushed. +build_and_push() { + image=$1 + build "${image}" + push "${image}" +} + # This function is for building the go code bin() { local arch_prefix=""