Install tiller as well if it exists (#4648)

* Install tiller as well if it exists

Signed-off-by: Yuya Takeyama <sign.of.the.wolf.pentagram@gmail.com>

* Fix message

ref: https://github.com/helm/helm/pull/4648#discussion_r218229227

Signed-off-by: Yuya Takeyama <sign.of.the.wolf.pentagram@gmail.com>
pull/4651/merge
Yuya Takeyama 6 years ago committed by Matthew Fisher
parent 1832d525b0
commit b7ea1c612d

@ -18,6 +18,7 @@
# the package manager for Go: https://github.com/Masterminds/glide.sh/blob/master/get # the package manager for Go: https://github.com/Masterminds/glide.sh/blob/master/get
PROJECT_NAME="helm" PROJECT_NAME="helm"
TILLER_NAME="tiller"
USE_SUDO="true" USE_SUDO="true"
: ${HELM_INSTALL_DIR:="/usr/local/bin"} : ${HELM_INSTALL_DIR:="/usr/local/bin"}
@ -142,8 +143,16 @@ installFile() {
mkdir -p "$HELM_TMP" mkdir -p "$HELM_TMP"
tar xf "$HELM_TMP_FILE" -C "$HELM_TMP" tar xf "$HELM_TMP_FILE" -C "$HELM_TMP"
HELM_TMP_BIN="$HELM_TMP/$OS-$ARCH/$PROJECT_NAME" HELM_TMP_BIN="$HELM_TMP/$OS-$ARCH/$PROJECT_NAME"
echo "Preparing to install into ${HELM_INSTALL_DIR}" TILLER_TMP_BIN="$HELM_TMP/$OS-$ARCH/$TILLER_NAME"
echo "Preparing to install $PROJECT_NAME and $TILLER_NAME into ${HELM_INSTALL_DIR}"
runAsRoot cp "$HELM_TMP_BIN" "$HELM_INSTALL_DIR" runAsRoot cp "$HELM_TMP_BIN" "$HELM_INSTALL_DIR"
echo "$PROJECT_NAME installed into $HELM_INSTALL_DIR/$PROJECT_NAME"
if [ -x "$TILLER_TMP_BIN" ]; then
runAsRoot cp "$TILLER_TMP_BIN" "$HELM_INSTALL_DIR"
echo "$TILLER_NAME installed into $HELM_INSTALL_DIR/$TILLER_NAME"
else
echo "info: $TILLER_NAME binary was not found in this release; skipping $TILLER_NAME installation"
fi
} }
# fail_trap is executed if an error occurs. # fail_trap is executed if an error occurs.
@ -165,7 +174,6 @@ fail_trap() {
# testVersion tests the installed client to make sure it is working. # testVersion tests the installed client to make sure it is working.
testVersion() { testVersion() {
set +e set +e
echo "$PROJECT_NAME installed into $HELM_INSTALL_DIR/$PROJECT_NAME"
HELM="$(which $PROJECT_NAME)" HELM="$(which $PROJECT_NAME)"
if [ "$?" = "1" ]; then if [ "$?" = "1" ]; then
echo "$PROJECT_NAME not found. Is $HELM_INSTALL_DIR on your "'$PATH?' echo "$PROJECT_NAME not found. Is $HELM_INSTALL_DIR on your "'$PATH?'

Loading…
Cancel
Save