From 1bbcbafa673620b593e84802df56d71638446efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Fri, 14 Jul 2023 16:52:25 +0200 Subject: [PATCH] ci: Add clone_cri_container() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tests/common.bash | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/common.bash b/tests/common.bash index 5f7fdb8460..d71b3f43ce 100644 --- a/tests/common.bash +++ b/tests/common.bash @@ -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 } +# 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 # version: the version of the tarball that will be downloaded # tarball-name: the name of the tarball that will be downloaded