mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-21 20:08:54 +00:00
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>
41 lines
946 B
Bash
Executable File
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
|