From f4437980b4958db506cff654c3d74669cb9dbd13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Wed, 19 Oct 2022 12:57:29 +0200 Subject: [PATCH] packaging: Allow passing an extra tag to build-and-upload-payload.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's modify the script so we allow passing an extra tag, which will be used as part of the Kata Containers pyload for Confidential Containers CI GitHub action. With this we can pass a `latest` tag, which will make things easier for the integration on the operator side. Signed-off-by: Fabiano FidĂȘncio --- .../kata-deploy-build-and-upload-payload.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh index a715b0f49..d7409c08e 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh @@ -8,6 +8,7 @@ KATA_DEPLOY_DIR="`dirname $0`/../../kata-deploy-cc" KATA_DEPLOY_ARTIFACT="${1:-"kata-static.tar.xz"}" REGISTRY="${2:-"quay.io/confidential-containers/runtime-payload"}" +TAG="${3:-}" echo "Copying $KATA_DEPLOY_ARTIFACT to $KATA_DEPLOY_DIR" cp $KATA_DEPLOY_ARTIFACT $KATA_DEPLOY_DIR @@ -22,4 +23,14 @@ docker build --tag $IMAGE_TAG . echo "Pushing the image to quay.io" docker push $IMAGE_TAG +if [ -n "${TAG}" ]; then + ADDITIONAL_TAG="${REGISTRY}:${TAG}" + + echo "Building the ${ADDITIONAL_TAG} image" + docker build --tag ${ADDITIONAL_TAG} . + + echo "Pushing the image ${ADDITIONAL_TAG} to quay.io" + docker push ${ADDITIONAL_TAG} +fi + popd