-
Notifications
You must be signed in to change notification settings - Fork 174
Expand file tree
/
Copy pathinstall_plugin.sh
More file actions
executable file
·42 lines (33 loc) · 1.35 KB
/
install_plugin.sh
File metadata and controls
executable file
·42 lines (33 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh -e
# Copied w/ love from the excellent hypnoglow/helm-s3
if [ -n "${HELM_PUSH_PLUGIN_NO_INSTALL_HOOK}" ]; then
echo "Development mode: not downloading versioned release."
exit 0
fi
version="$(cat plugin.yaml | grep "version" | cut -d '"' -f 2)"
RELEASE_PACKAGE="releases/v${version}.tar.gz"
if [ ! -f ${RELEASE_PACKAGE} ]; then
echo "Downloading and installing helm-push v${version} ..."
url=""
if [ "$(uname)" = "Darwin" ]; then
url="https://github.com/chartmuseum/helm-push/releases/download/v${version}/helm-push_${version}_darwin_amd64.tar.gz"
elif [ "$(uname)" = "Linux" ] ; then
url="https://github.com/chartmuseum/helm-push/releases/download/v${version}/helm-push_${version}_linux_amd64.tar.gz"
else
url="https://github.com/chartmuseum/helm-push/releases/download/v${version}/helm-push_${version}_windows_amd64.tar.gz"
fi
echo $url
# Download with curl if possible.
if [ -x "$(which curl 2>/dev/null)" ]; then
curl -sSL "${url}" -o ${RELEASE_PACKAGE}
else
wget -q "${url}" -O ${RELEASE_PACKAGE}
fi
else
echo "helm-push already exist..."
fi
mkdir -p "bin"
mkdir -p "releases/v${version}"
tar xzf ${RELEASE_PACKAGE} -C "releases/v${version}"
mv "releases/v${version}/bin/helmpush" "bin/helmpush" || \
mv "releases/v${version}/bin/helmpush.exe" "bin/helmpush"