kata-deploy-binaries: Avoid pushd / popd if not needed

Let's avoid getting into a dir and risking not being able to leave that
dir in case something fails.

Instead, let's just stay in the current dir and move the final tarball
to the exoected directory in case all the checks go as expected.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio
2022-12-04 17:10:05 +01:00
parent 724108a817
commit 56d5d5932d

View File

@@ -126,12 +126,11 @@ install_cached_component() {
[ "${cached_version}" != "${current_version}" ] && return 1
info "Using cached tarball of ${component}"
pushd ${workdir}
echo "Downloading tarball from: ${jenkins_build_url}/${component_tarball_name}"
curl -fL --progress-bar "${jenkins_build_url}/${component_tarball_name}" -o "${component_tarball_path}" || return cleanup_and_fail
curl -fL --progress-bar "${jenkins_build_url}/${component_tarball_name}" -o "${component_tarball_name}" || return cleanup_and_fail
curl -fsOL "${jenkins_build_url}/sha256sum-${component_tarball_name}" || return cleanup_and_fail
sha256sum -c "sha256sum-${component_tarball_name}" || return cleanup_and_fail
popd
mv "${component_tarball_name}" "${component_tarball_path}"
}
# Install static CC cloud-hypervisor asset