From 7854cf007ac18088041ab6fa2192e4595cc43c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Fri, 15 Oct 2021 21:20:44 +0200 Subject: [PATCH] kata-deploy: Add a basic script to build & upload a CCv0 image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a dirty hack, that we should expand later so we can pass one or n number of repos where we'll upload our images, and use it as part of the release scripts. For now, however, let's just do this quick & dirty hack so we can present the CCv0 demo using the operator, even knowing that the kubernetes part of the work is not done yet and that the demo itself will be done connecting to a node and doing all the shenanigans manually. Fixes: #2854 Signed-off-by: Fabiano FidĂȘncio --- .../kata-deploy/local-build/Makefile | 3 +++ .../kata-deploy-build-and-upload-image.sh | 24 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100755 tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-image.sh diff --git a/tools/packaging/kata-deploy/local-build/Makefile b/tools/packaging/kata-deploy/local-build/Makefile index 68e45d447..9bc61c9ec 100644 --- a/tools/packaging/kata-deploy/local-build/Makefile +++ b/tools/packaging/kata-deploy/local-build/Makefile @@ -59,3 +59,6 @@ merge-builds: install-tarball: tar -xvf ./kata-static.tar.xz -C / + +image: kata-tarball + $(MK_DIR)kata-deploy-build-and-upload-image.sh $(CURDIR)/kata-static.tar.xz diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-image.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-image.sh new file mode 100755 index 000000000..1db840a19 --- /dev/null +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-image.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# +# Copyright 2021 Fabiano FidĂȘncio +# +# SPDX-License-Identifier: Apache-2.0 +# + +KATA_DEPLOY_DIR="`dirname $0`/../" +KATA_DEPLOY_ARTIFACT="$1" + +echo "Copying $KATA_DEPLOY_ARTIFACT to $KATA_DEPLOY_DIR" +cp $KATA_DEPLOY_ARTIFACT $KATA_DEPLOY_DIR + +pushd $KATA_DEPLOY_DIR + +IMAGE_TAG="quay.io/kata-containers/kata-deploy-cc:v0" + +echo "Building the image" +docker build --tag $IMAGE_TAG . + +echo "Pushing the image to quay.io" +docker push $IMAGE_TAG + +popd