mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-10 04:18:26 +00:00
release: Introduce helper to get GitHub CLI
If gh isn't installed already, download it from GitHub. Signed-off-by: Greg Kurz <groug@kaod.org>
This commit is contained in:
parent
ceeabe3714
commit
b83a7149ee
@ -16,6 +16,7 @@ export repo_root_dir="$(cd "${this_script_dir}/../../../" && pwd)"
|
|||||||
short_commit_length=10
|
short_commit_length=10
|
||||||
|
|
||||||
hub_bin="hub-bin"
|
hub_bin="hub-bin"
|
||||||
|
gh_cli="gh-cli"
|
||||||
|
|
||||||
#for cross build
|
#for cross build
|
||||||
CROSS_BUILD=${CROSS_BUILD-:}
|
CROSS_BUILD=${CROSS_BUILD-:}
|
||||||
@ -93,6 +94,22 @@ arch_to_golang()
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_gh() {
|
||||||
|
info "Get gh"
|
||||||
|
|
||||||
|
if cmd=$(command -v gh); then
|
||||||
|
gh_cli="${cmd}"
|
||||||
|
return
|
||||||
|
else
|
||||||
|
gh_cli="${tmp_dir:-/tmp}/gh-cli"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local goarch=$(arch_to_golang $(uname -m))
|
||||||
|
curl -sSL https://github.com/cli/cli/releases/download/v2.37.0/gh_2.37.0_linux_${goarch}.tar.gz | tar -xz
|
||||||
|
mv gh_2.37.0_linux_${goarch}/bin/gh "${gh_cli}"
|
||||||
|
rm -rf gh_2.37.0_linux_amd64
|
||||||
|
}
|
||||||
|
|
||||||
get_kata_hash() {
|
get_kata_hash() {
|
||||||
repo=$1
|
repo=$1
|
||||||
ref=$2
|
ref=$2
|
||||||
|
Loading…
Reference in New Issue
Block a user