From bbf24620dde947060279c22c3d02c0514d654888 Mon Sep 17 00:00:00 2001 From: "Deavon M. McCaffery" Date: Mon, 14 Aug 2017 09:13:19 -0700 Subject: [PATCH] feat(helm): add helm install and completion --- src/scripts/Darwin/minikube-install.sh | 15 ++++++++++++++- src/scripts/set-prompt.sh | 4 ++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/scripts/Darwin/minikube-install.sh b/src/scripts/Darwin/minikube-install.sh index e1cd810..9dd39bc 100644 --- a/src/scripts/Darwin/minikube-install.sh +++ b/src/scripts/Darwin/minikube-install.sh @@ -7,7 +7,17 @@ fi minikube-install() { echo "Installing minikube..." brew update - brew install docker-machine-driver-xhyve kubernetes-cli Caskroom/cask/minikube + + for pkg in docker-machine-driver-xhyve kubernetes-cli Caskroom/cask/minikube kubernetes-helm; do + if brew list -1 | grep -q "^${pkg}\$"; then + echo "upgrading: $pkg" + brew upgrade $pkg 1>/dev/null 2>&1 + brew link --overwrite $pkg 1>/dev/null 2>&1 + else + echo "installing: $pkg" + brew install $pkg 1>/dev/null 2>&1 + fi + done echo "Setting ownership of docker-machine-driver-xhyve: you will be prompted for your password..." sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve @@ -19,6 +29,9 @@ minikube-install() { echo "Starting minikube..." minikube start --insecure-registry localhost:5000 + echo "Installing helm and tiller..." + helm init + echo "Using docker environment from minikube..." eval $(minikube docker-env) diff --git a/src/scripts/set-prompt.sh b/src/scripts/set-prompt.sh index 9c8745b..7998356 100644 --- a/src/scripts/set-prompt.sh +++ b/src/scripts/set-prompt.sh @@ -47,6 +47,10 @@ __prompt-set-prompt() { eval "$(kubectl completion bash)" 1>/dev/null 2>&1; fi + if type helm 1>/dev/null 2>&1; then + eval "$(helm completion bash)" 1>/dev/null 2>&1; + fi + if [ -f $LOCAL_PREFIX/etc/bash_completion ]; then source $LOCAL_PREFIX/etc/bash_completion elif [ -f /etc/bash_completion ]; then