workflows: Publish kata-deploy payload after a merge

For the architectures we know that `make kata-tarball` works as
expected, let's start publishing the kata-deploy payload after each
merge.

This will help to:
* Easily test the content of current `main` or `stable-*` branch
* Easily bisect issues
* Start providing some sort of CI/CD content pipeline for those who
  need that

This is a forward-port work from the `CCv0` and groups together patches
that I've worked on, with the work that Choi did in order to support
different architectures.

Fixes: #6343

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio
2023-02-21 12:19:21 +01:00
parent 785310fe18
commit bd1ed26c8d
5 changed files with 408 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
#!/usr/bin/env bash
#
# Copyright 2022 Intel
#
# SPDX-License-Identifier: Apache-2.0
#
KATA_DEPLOY_DIR="`dirname ${0}`/../../kata-deploy-cc"
KATA_DEPLOY_ARTIFACT="${1:-"kata-static.tar.xz"}"
REGISTRY="${2:-"quay.io/kata-containers/kata-deploy"}"
TAG="${3:-}"
echo "Copying ${KATA_DEPLOY_ARTIFACT} to ${KATA_DEPLOY_DIR}"
cp ${KATA_DEPLOY_ARTIFACT} ${KATA_DEPLOY_DIR}
pushd ${KATA_DEPLOY_DIR}
IMAGE_TAG="${REGISTRY}:kata-containers-$(git rev-parse HEAD)-$(uname -m)"
echo "Building the image"
if [ "$(uname -m)" = "s390x" ]; then
docker build \
--build-arg IMG_NAME=clefos \
--build-arg IMG_TAG=7 \
--tag ${IMAGE_TAG} .
else
docker build --tag ${IMAGE_TAG} .
fi
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"
if [ "$(uname -m)" = "s390x" ]; then
docker build \
--build-arg IMG_NAME=clefos \
--build-arg IMG_TAG=7 \
--tag ${ADDITIONAL_TAG} .
else
docker build --tag ${ADDITIONAL_TAG} .
fi
echo "Pushing the image ${ADDITIONAL_TAG} to quay.io"
docker push ${ADDITIONAL_TAG}
fi
popd