-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5260ba1
commit e3fe446
Showing
3 changed files
with
13 additions
and
14 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 |
---|---|---|
@@ -1,13 +1,15 @@ | ||
#!/usr/bin/env sh | ||
# this was copied from [email protected]:databus23/helm-diff | ||
cd $HELM_PLUGIN_DIR | ||
set -e | ||
if [ "$HELM_DEBUG" = true ]; then | ||
set -x | ||
env | sort | ||
fi | ||
|
||
REPO_URL=$(git remote get-url origin) | ||
PROJECT_NAME=${HELM_PLUGIN_DIR##*/} | ||
PROJECT_GH=$(echo "${REPO_URL##*:}" | sed -r 's!.git$!!g') | ||
PROJECT_GH=$(echo "${REPO_URL}" | awk -F'/' '{print $4"/"$5}' | sed -r 's!\.git$!!g') | ||
export GREP_COLOR="never" | ||
|
||
# Convert HELM_BIN and HELM_PLUGIN_DIR to unix if cygpath is | ||
|
@@ -84,7 +86,7 @@ downloadFile() { | |
echo "Either curl or wget is required" | ||
exit 1 | ||
fi | ||
version=$(git -C "$HELM_PLUGIN_DIR" describe --tags --exact-match 2>/dev/null | sed 's/^v//g' || :) | ||
version=$(git describe --tags --exact-match 2>/dev/null | sed 's/^v//g' || :) | ||
if [ "$SCRIPT_MODE" = "install" ] && [ -n "$version" ]; then | ||
DOWNLOAD_URL="https://github.com/$PROJECT_GH/releases/download/v$version/${PROJECT_NAME}_${version}_${OS}_${ARCH}.tar.gz" | ||
else | ||
|
@@ -110,24 +112,22 @@ exit_trap() { | |
rmTempDir | ||
if [ "$result" != "0" ]; then | ||
echo "Failed to install $PROJECT_NAME" | ||
printf '\tFor support, go to ${REPO_URL}.\n' | ||
echo "For support, go to ${REPO_URL}." | ||
fi | ||
exit $result | ||
} | ||
|
||
# testVersion tests the installed client to make sure it is working. | ||
testVersion() { | ||
set +e | ||
echo "${PROJECT_NAME} installed into $HELM_PLUGIN_DIR" | ||
"$HELM_BIN" "$HELM_PLUGIN_NAME" -h | ||
set -e | ||
} | ||
|
||
# Execution | ||
|
||
#Stop execution on any error | ||
trap "exit_trap" EXIT | ||
set -e | ||
|
||
initArch | ||
initOS | ||
mkTempDir | ||
|
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
name: "clean" | ||
version: "0.5.0" | ||
usage: "plugin to clean no updated release" | ||
description: "plugin to clean no updated release" | ||
platformCommand: | ||
- command: "$HELM_PLUGIN_DIR/helm-clean" | ||
usage: "List/Clean out of date releases" | ||
description: "List/Clean out of date releases" | ||
command: "$HELM_PLUGIN_DIR/helm-clean" | ||
hooks: | ||
install: "$HELM_PLUGIN_DIR/install-binary.sh" | ||
update: "$HELM_PLUGIN_DIR/install-binary.sh -u" |