-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
helm.sh
executable file
·50 lines (44 loc) · 1.09 KB
/
helm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash +e
temp="/tmp/rook-tests-scripts-helm"
helm_version="${HELM_VERSION:-"v3.8.0"}"
arch="${ARCH:-}"
detectArch() {
case "$(uname -m)" in
"x86_64" | "amd64")
arch="amd64"
;;
"aarch64")
arch="arm64"
;;
"i386")
arch="i386"
;;
*)
echo "Couldn't translate 'uname -m' output to an available arch."
echo "Try setting ARCH environment variable to your system arch:"
echo "amd64, x86_64. aarch64, i386"
exit 1
;;
esac
}
install() {
# Download and unpack helm
local dist
dist="$(uname -s)"
dist=$(echo "${dist}" | tr "[:upper:]" "[:lower:]")
mkdir -p "${temp}"
wget "https://get.helm.sh/helm-${helm_version}-${dist}-${arch}.tar.gz" -O "${temp}/helm.tar.gz"
tar -C "${temp}" -xvf "${temp}/helm.tar.gz" --strip-components 1
}
if [ -z "${arch}" ]; then
detectArch
fi
case "${1:-}" in
up)
install
;;
*)
echo "usage:" >&2
echo " $0 up" >&2
echo " $0 clean" >&2
esac