-
Notifications
You must be signed in to change notification settings - Fork 626
Helm
Aurélien Maury edited this page Oct 1, 2021
·
1 revision
This snippets depends on Direnv bin dir
Install helm in your direnv bin directory IF no helm binary is found.
Configuration environments variable:
-
HELM_VERSION
(defaults to "3.6.3" in this example) -
HELM_ARCH
(defaults to 'linux-amd64' in this example)
In your .envrc
:
#
# Auto-install Helm
# =================
#
HELM_VERSION="3.6.3"
HELM_ARCH="linux-amd64"
HELM_PKG_NAME="helm-v${HELM_VERSION}-${HELM_ARCH}.tar.gz"
HELM_PKG_URL="https://get.helm.sh/${HELM_PKG_NAME}"
HELM_PKG_PATH="${DIRENV_TMP_DIR}/${HELM_PKG_NAME}"
if [ ! -e "${DIRENV_BIN_DIR}/helm" ]; then
echo "===> Getting helm:${HELM_VERSION}:${HELM_ARCH} (can take a while to execute)"
curl -s -L "${HELM_PKG_URL}" -o "${HELM_PKG_PATH}"
tar zx -f ${HELM_PKG_PATH} -C ${DIRENV_TMP_DIR}
mv ${DIRENV_TMP_DIR}/${HELM_ARCH}/helm ${DIRENV_BIN_DIR}
chmod 700 ${DIRENV_BIN_DIR}/helm
rm -rf ${DIRENV_TMP_DIR}/${HELM_ARCH} ${HELM_PKG_PATH}
fi