release: Checkout right version of kernel patches

Checkout tag for packaging repo based on env variable NEW_VERSION
or kata_version with kata_version taking precedence.
With this, we checkout to the right version of packaging repo before
applying kernel patches.

Fixes #849

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit is contained in:
Archana Shinde 2019-12-03 18:03:24 -08:00
parent 9377c5d5ca
commit ff20f2008b

View File

@ -271,7 +271,13 @@ get_config_and_patches() {
if [ -z "${patches_path}" ]; then
info "Clone config and patches"
patches_path="${default_patches_dir}"
[ -d "${patches_path}" ] || git clone "https://${patches_repo}.git" "${patches_repo_dir}"
if [ ! -d "${patches_path}" ]; then
tag="${kata_version:-$NEW_VERSION}"
git clone "https://${patches_repo}.git" "${patches_repo_dir}"
pushd "${patches_repo_dir}" >> /dev/null
git checkout $tag
popd >> /dev/null
fi
fi
}