Files
kata-containers/tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh
Fabiano Fidêncio 59fdd69b85 kata-deploy: Add VERSION and versions.yaml to the final tarball
Let's make things simpler to figure out which version of Kata
Containers has been deployed, and also which artefacts come with it.

This will help us immensely in the future, for the TEEs use case, so we
can easily know whether we can deploy a specific guest kernel for a
specific host kernel.

Fixes: #7394

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-07-20 18:33:14 +02:00

41 lines
946 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) 2021 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
[ -z "${DEBUG}" ] || set -x
set -o errexit
set -o nounset
set -o pipefail
set -o errtrace
kata_build_dir=${1:-build}
kata_versions_yaml_file=${2:-""}
tar_path="${PWD}/kata-static.tar.xz"
pushd "${kata_build_dir}"
tarball_content_dir="${PWD}/kata-tarball-content"
rm -rf "${tarball_content_dir}"
mkdir "${tarball_content_dir}"
for c in kata-static-*.tar.xz
do
echo "untarring tarball "${c}" into ${tarball_content_dir}"
tar -xvf "${c}" -C "${tarball_content_dir}"
done
pushd ${tarball_content_dir}
shim="containerd-shim-kata-v2"
shim_path=$(find . -name ${shim} | sort | head -1)
prefix=${shim_path%"bin/${shim}"}
echo "$(git describe)" > ${prefix}/VERSION
[[ -n "${kata_versions_yaml_file}" ]] && cp ${kata_versions_yaml_file} ${prefix}/
popd
echo "create ${tar_path}"
(cd "${tarball_content_dir}"; tar cvfJ "${tar_path}" .)
popd