kata-containers/tools/packaging/static-build/stratovirt/build-static-stratovirt.sh
Beraldo Leal c99ba42d62 deps: bumping yq to v4.40.7
Since yq frequently updates, let's upgrade to a version from February to
bypass potential issues with versions 4.41-4.43 for now. We can always
upgrade to the newest version if necessary.

Fixes #9354
Depends-on:github.com/kata-containers/tests#5818

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2024-05-31 13:28:34 -04:00

39 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# Copyright (c) 2023 Huawei Technologies Co.,Ltd.
#
# SPDX-License-Identifier: Apache-2.0
set -o errexit
set -o nounset
set -o pipefail
ARCH=$(uname -m)
# Currently, StratoVirt only support x86_64 and aarch64.
[ "${ARCH}" != "x86_64" ] && [ "${ARCH}" != "aarch64" ] && exit
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${script_dir}/../../scripts/lib.sh"
info "Get stratovirt information from runtime versions.yaml"
stratovirt_url="${stratovirt_url:-}"
[ -n "$stratovirt_url" ] || stratovirt_url=$(get_from_kata_deps ".assets.hypervisor.stratovirt.url")
[ -n "$stratovirt_url" ] || die "failed to get stratovirt url"
stratovirt_version="${stratovirt_version:-}"
[ -n "$stratovirt_version" ] || stratovirt_version=$(get_from_kata_deps ".assets.hypervisor.stratovirt.version")
[ -n "$stratovirt_version" ] || die "failed to get stratovirt version"
pull_stratovirt_released_binary() {
file_name="stratovirt-static-${stratovirt_version##*v}-${ARCH}"
download_url="${stratovirt_url}/releases/download/${stratovirt_version}/${file_name}.tar.gz"
curl -L ${download_url} -o ${file_name}.tar.gz
mkdir -p static-stratovirt
tar zxvf ${file_name}.tar.gz -C static-stratovirt
}
pull_stratovirt_released_binary