mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 23:04:20 +01:00
We need to correctly get the full path of the versions.yaml file as part of the merge-builds.sh script, as we do a `pushd` there and that leads to a fail merging the artefacts as the `versions.yaml` file does not exists in that path. Fixes: #7405 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
42 lines
1016 B
Bash
Executable File
42 lines
1016 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"
|
|
kata_versions_yaml_file_path="${PWD}/${kata_versions_yaml_file}"
|
|
|
|
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_path} ${prefix}/
|
|
popd
|
|
|
|
echo "create ${tar_path}"
|
|
(cd "${tarball_content_dir}"; tar cvfJ "${tar_path}" .)
|
|
popd
|