ci: Add clone_cri_container()

This function will simply clone containerd repo, specifically on a tag
we want to use to test.

This can be expanded for different projects, and it will be the case as
soon as we grow the tests.  But, for now, let's keep it simple.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2023-07-14 16:52:25 +02:00
parent f66c68a2bf
commit 1bbcbafa67

View File

@ -361,6 +361,17 @@ function get_latest_patch_release_from_a_github_project() {
curl --silent https://api.github.com/repos/${project}/releases | jq -r .[].tag_name | grep "^${base_version}.[0-9]*$" -m1 curl --silent https://api.github.com/repos/${project}/releases | jq -r .[].tag_name | grep "^${base_version}.[0-9]*$" -m1
} }
# base_version: The version to be intalled in the ${major}.${minor} format
function clone_cri_containerd() {
base_version="${1}"
project="containerd/containerd"
version=$(get_latest_patch_release_from_a_github_project "${project}" "${base_version}")
rm -rf containerd
git clone -b ${version} https://github.com/${project}
}
# project: org/repo format # project: org/repo format
# version: the version of the tarball that will be downloaded # version: the version of the tarball that will be downloaded
# tarball-name: the name of the tarball that will be downloaded # tarball-name: the name of the tarball that will be downloaded