-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to install helm for dynamic OS and ARCH (#521)
- Loading branch information
Showing
2 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#! /bin/bash | ||
HELM_VERSION=v3.16.1 | ||
|
||
# initOS discovers the operating system for this system. | ||
initOS() { | ||
OS=$(echo `uname`|tr '[:upper:]' '[:lower:]') | ||
|
||
case "$OS" in | ||
# Minimalist GNU for Windows | ||
mingw*|cygwin*) OS='windows';; | ||
esac | ||
} | ||
|
||
# initArch discovers the architecture for this system. | ||
initArch() { | ||
ARCH=$(uname -m) | ||
case $ARCH in | ||
armv5*) ARCH="armv5";; | ||
armv6*) ARCH="armv6";; | ||
armv7*) ARCH="arm";; | ||
aarch64) ARCH="arm64";; | ||
x86) ARCH="386";; | ||
x86_64) ARCH="amd64";; | ||
i686) ARCH="386";; | ||
i386) ARCH="386";; | ||
esac | ||
} | ||
|
||
initOS | ||
initArch | ||
HELM_DIST="helm-${HELM_VERSION}-${OS}-${ARCH}.tar.gz" | ||
wget https://get.helm.sh/${HELM_DIST} | ||
tar -zxvf ${HELM_DIST} | ||
mv ${OS}-${ARCH}/helm /usr/local/bin/helm | ||
rm ${HELM_DIST} | ||
rm -rf ${OS}-${ARCH} | ||
|