From ad47d1b9f85e7a1f3aa0e9b017ba3baa271ced20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 13 Jul 2023 13:15:22 +0200 Subject: [PATCH] ci: Add download_github_project_tarball() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function will hel us to get the tarball, from a github project, that we're going to use as part of our tests. Right now this is not used anywhere, but it'll soon enough (as part of this series) be used to download the cri-containerd / cri-tools / cni tarballs. 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 34d1f3c88d..ea48d5eff3 100644 --- a/tests/common.bash +++ b/tests/common.bash @@ -360,3 +360,14 @@ 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 } + +# 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 +function download_github_project_tarball() { + project="${1}" + version="${2}" + tarball_name="${3}" + + wget https://github.com/${project}/releases/download/${version}/${tarball_name} +}