kata-deploy: Add script to merge kata tarballs.

After each asset is build it is needed to merge them all into one single
tarball.

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
This commit is contained in:
Carlos Venegas 2021-06-29 15:47:26 +00:00
parent 4895747f35
commit b9d2eea39b

View File

@ -0,0 +1,28 @@
#!/bin/bash
# Copyright (c) 2021 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
set -o errexit
set -o nounset
set -o pipefail
set -o errtrace
kata_build_dir=${1:-build}
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
echo "create ${tar_path}"
(cd "${tarball_content_dir}"; tar cvfJ "${tar_path}" .)
popd