forked from linkerd/linkerd2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
helm
executable file
·35 lines (31 loc) · 861 Bytes
/
helm
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
#!/usr/bin/env sh
set -eu
helmversion=v3.2.1
bindir=$( cd "${0%/*}" && pwd )
targetbin=$( cd "$bindir"/.. && pwd )/target/bin
helmbin=$targetbin/helm-$helmversion
if [ ! -f "$helmbin" ]; then
if [ "$(uname -s)" = Darwin ]; then
os=darwin
arch=amd64
else
os=linux
case $(uname -m) in
x86_64) arch=amd64 ;;
arm) dpkg --print-architecture | grep -q arm64 && arch=arm64 || arch=arm ;;
esac
fi
helmcurl="https://get.helm.sh/helm-$helmversion-$os-$arch.tar.gz"
targetdir=$os-$arch
tmp=$(mktemp -d -t helm.XXX)
mkdir -p "$targetbin"
(
cd "$tmp"
curl -Lsf -o "./helm.tar.gz" "$helmcurl"
tar zf "./helm.tar.gz" -x "$targetdir"
chmod +x "$targetdir/helm"
)
mv "$tmp/$targetdir/helm" "$helmbin"
rm -rf "$tmp"
fi
"$helmbin" "$@"