-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall-plugin.sh
More file actions
executable file
·45 lines (37 loc) · 1.61 KB
/
install-plugin.sh
File metadata and controls
executable file
·45 lines (37 loc) · 1.61 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
42
43
44
45
#!/bin/sh -e
if [ -n "${HELM_BLOB_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)"
echo "Downloading and installing helm-blob v${version} ..."
# Downloding binary from github
url=""
if [ "$(uname)" = "Darwin" ]; then
url="https://github.com/C123R/helm-blob/releases/download/v${version}/helm-blob_darwin_amd64_v${version}.tar.gz"
elif [ "$(uname)" = "Linux" ]; then
if [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then
url="https://github.com/C123R/helm-blob/releases/download/v${version}/helm-blob_linux_arm64_v${version}.tar.gz"
else
url="https://github.com/C123R/helm-blob/releases/download/v${version}/helm-blob_linux_amd64_v${version}.tar.gz"
fi
else
url="https://github.com/C123R/helm-blob/releases/download/v${version}/helm-blob_windows_amd64_v${version}.tar.gz"
fi
# Installing binary
mkdir -p "bin"
mkdir -p "releases/v${version}"
# Download with curl if possible.
if [ -x "$(which curl 2>/dev/null)" ]; then
curl -sSL "${url}" -o "releases/v${version}.tar.gz"
else
wget -q "${url}" -O "releases/v${version}.tar.gz"
fi
tar xzf "releases/v${version}.tar.gz" -C "releases/v${version}"
mv "releases/v${version}/helm-blob" "bin/helm-blob" ||
mv "releases/v${version}/helm-blob.exe" "bin/helm-blob"
mv "releases/v${version}/scripts/proxy.sh" "bin/proxy.sh"
mv "releases/v${version}/plugin.yaml" "bin/plugin.yaml"
mv "releases/v${version}/README.md" "bin/README.md"
mv "releases/v${version}/LICENSE" "bin/LICENSE"
rm -rf "releases/v${version}.tar.gz"