Skip to content

Instantly share code, notes, and snippets.

@liam102
Last active May 6, 2020 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liam102/f5bf54447d888ea6638ed6d3173641b3 to your computer and use it in GitHub Desktop.
Save liam102/f5bf54447d888ea6638ed6d3173641b3 to your computer and use it in GitHub Desktop.
Update Helm CLI
#!/usr/bin/env bash
WHEREIAM=`cd $(dirname $BASH_SOURCE) && pwd`
MY_PATH="${HOME}/App"
HELM_VERSION=$1
ZFILE="helm-v${HELM_VERSION}-darwin-amd64.tar.gz"
if [[ -z "$HELM_VERSION" ]]; then
echo "Current Helm version: "
helm version
exit 0
fi
cd $WHEREIAM
wget "https://get.helm.sh/helm-v${HELM_VERSION}-darwin-amd64.tar.gz"
if [[ ! -f "$ZFILE" ]]; then
echo ">> VERSION ${HELM_VERSION} NOT FOUND"
exit 1
fi
tar -xf $ZFILE
mv darwin-amd64/helm $MY_PATH
rm -r darwin-amd64
rm $ZFILE
cd - > /dev/null
if [[ $? == 0 ]]; then
echo "Helm is upgraded >> $(helm version)"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment