packaging: Allow passing an extra tag to build-and-upload-payload.sh

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 <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio
2022-10-19 12:57:29 +02:00
parent 54544dd617
commit f4437980b4

View File

@@ -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