Skip to content

Commit a91287c

Browse files
committed
Convert line endings back
1 parent 28a4b37 commit a91287c

File tree

1 file changed

+79
-79
lines changed

1 file changed

+79
-79
lines changed

scripts/install_plugin.sh

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
1-
#!/bin/sh -e
2-
3-
# Copied w/ love from the chartmuseum/helm-push :)
4-
5-
if [ -n "$HELM_DEBUG" ]; then
6-
set -x
7-
fi
8-
9-
name="helm-dashboard"
10-
repo="https://github.com/komodorio/${name}"
11-
api_repo="https://api.github.com/repos/komodorio/${name}/releases/latest"
12-
13-
if [ -n "${HELM_PUSH_PLUGIN_NO_INSTALL_HOOK}" ]; then
14-
echo "Development mode: not downloading versioned release."
15-
exit 0
16-
fi
17-
18-
version="$(curl -X GET ${api_repo} | grep '\"name\": "v.*\"' | cut -d 'v' -f 2 | cut -d '"' -f 1)"
19-
echo Tried to autodetect latest version: $version
20-
[ -z "$version" ] && {
21-
version="$(cat plugin.yaml | grep "version" | cut -d '"' -f 2)"
22-
echo Defaulted to version: $version
23-
}
24-
echo "Downloading and installing ${name} v${version} ..."
25-
26-
url=""
27-
28-
# convert architecture of the target system to a compatible GOARCH value.
29-
# Otherwise failes to download of the plugin from github, because the provided
30-
# architecture by `uname -m` is not part of the github release.
31-
arch=""
32-
case $(uname -m) in
33-
x86_64)
34-
arch="x86_64"
35-
;;
36-
armv6*)
37-
arch="armv6"
38-
;;
39-
# match every arm processor version like armv7h, armv7l and so on.
40-
armv7*)
41-
arch="armv7"
42-
;;
43-
aarch64 | arm64)
44-
arch="arm64"
45-
;;
46-
*)
47-
echo "Failed to detect target architecture"
48-
exit 1
49-
;;
50-
esac
51-
52-
53-
if [ "$(uname)" = "Darwin" ]; then
54-
url="${repo}/releases/download/v${version}/${name}_${version}_Darwin_${arch}.tar.gz"
55-
elif [ "$(uname)" = "Linux" ] ; then
56-
url="${repo}/releases/download/v${version}/${name}_${version}_Linux_${arch}.tar.gz"
57-
else
58-
url="${repo}/releases/download/v${version}/${name}_${version}_windows_${arch}.tar.gz"
59-
fi
60-
61-
echo $url
62-
63-
mkdir -p "bin"
64-
mkdir -p "releases/v${version}"
65-
66-
# Download with curl if possible.
67-
if [ -x "$(which curl 2>/dev/null)" ]; then
68-
curl --fail -sSL "${url}" -o "releases/v${version}.tar.gz"
69-
else
70-
wget -q "${url}" -O "releases/v${version}.tar.gz"
71-
fi
72-
tar xzf "releases/v${version}.tar.gz" -C "releases/v${version}"
73-
mv "releases/v${version}/${name}" "bin/${name}" || \
74-
mv "releases/v${version}/${name}.exe" "bin/${name}"
75-
76-
echo
77-
echo "Helm Dashboard is installed, to start it, run in your terminal:"
78-
echo " helm dashboard"
79-
echo
1+
#!/bin/sh -e
2+
3+
# Copied w/ love from the chartmuseum/helm-push :)
4+
5+
if [ -n "$HELM_DEBUG" ]; then
6+
set -x
7+
fi
8+
9+
name="helm-dashboard"
10+
repo="https://github.com/komodorio/${name}"
11+
api_repo="https://api.github.com/repos/komodorio/${name}/releases/latest"
12+
13+
if [ -n "${HELM_PUSH_PLUGIN_NO_INSTALL_HOOK}" ]; then
14+
echo "Development mode: not downloading versioned release."
15+
exit 0
16+
fi
17+
18+
version="$(curl -X GET ${api_repo} | grep '\"name\": "v.*\"' | cut -d 'v' -f 2 | cut -d '"' -f 1)"
19+
echo Tried to autodetect latest version: $version
20+
[ -z "$version" ] && {
21+
version="$(cat plugin.yaml | grep "version" | cut -d '"' -f 2)"
22+
echo Defaulted to version: $version
23+
}
24+
echo "Downloading and installing ${name} v${version} ..."
25+
26+
url=""
27+
28+
# convert architecture of the target system to a compatible GOARCH value.
29+
# Otherwise failes to download of the plugin from github, because the provided
30+
# architecture by `uname -m` is not part of the github release.
31+
arch=""
32+
case $(uname -m) in
33+
x86_64)
34+
arch="x86_64"
35+
;;
36+
armv6*)
37+
arch="armv6"
38+
;;
39+
# match every arm processor version like armv7h, armv7l and so on.
40+
armv7*)
41+
arch="armv7"
42+
;;
43+
aarch64 | arm64)
44+
arch="arm64"
45+
;;
46+
*)
47+
echo "Failed to detect target architecture"
48+
exit 1
49+
;;
50+
esac
51+
52+
53+
if [ "$(uname)" = "Darwin" ]; then
54+
url="${repo}/releases/download/v${version}/${name}_${version}_Darwin_${arch}.tar.gz"
55+
elif [ "$(uname)" = "Linux" ] ; then
56+
url="${repo}/releases/download/v${version}/${name}_${version}_Linux_${arch}.tar.gz"
57+
else
58+
url="${repo}/releases/download/v${version}/${name}_${version}_windows_${arch}.tar.gz"
59+
fi
60+
61+
echo $url
62+
63+
mkdir -p "bin"
64+
mkdir -p "releases/v${version}"
65+
66+
# Download with curl if possible.
67+
if [ -x "$(which curl 2>/dev/null)" ]; then
68+
curl --fail -sSL "${url}" -o "releases/v${version}.tar.gz"
69+
else
70+
wget -q "${url}" -O "releases/v${version}.tar.gz"
71+
fi
72+
tar xzf "releases/v${version}.tar.gz" -C "releases/v${version}"
73+
mv "releases/v${version}/${name}" "bin/${name}" || \
74+
mv "releases/v${version}/${name}.exe" "bin/${name}"
75+
76+
echo
77+
echo "Helm Dashboard is installed, to start it, run in your terminal:"
78+
echo " helm dashboard"
79+
echo

0 commit comments

Comments
 (0)