-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall.sh
executable file
·58 lines (47 loc) · 1.48 KB
/
install.sh
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
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
set -e
echo "Getting kubectl-frisbee plugin"
_detect_arch() {
case $(uname -m) in
amd64|x86_64) echo "amd64"
;;
arm64|aarch64) echo "arm64"
;;
i386) echo "386"
;;
*) echo "Unsupported processor architecture";
return 1
;;
esac
}
_detect_os(){
case $(uname) in
Linux) echo "linux"
;;
#Darwin) echo "macOS"
#;;
#Windows) echo "Windows"
#;;
esac
}
_download_url() {
local arch="$(_detect_arch)"
local os="$(_detect_os)"
if [ -z "$FRISBEE_VERSION" ]
then
local version=`curl -s https://api.github.com/repos/carv-ics-forth/frisbee/releases/latest 2>/dev/null | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`
echo https://github.com/CARV-ICS-FORTH/frisbee/releases/download/${version}/kubectl-frisbee_${version:1}_${os}_${arch}
else
echo https://github.com/CARV-ICS-FORTH/frisbee/releases/download/v${FRISBEE_VERSION}/kubectl-frisbee_${FRISBEE_VERSION}_${os}_${arch}
fi
}
echo "Downloading frisbee from URL: $(_download_url)"
curl -sSLf $(_download_url) > kubectl-frisbee
chmod +x kubectl-frisbee
sudo mv kubectl-frisbee /usr/local/bin/kubectl-frisbee
echo "kubectl-frisbee installed in:"
echo "- /usr/local/bin/kubectl-frisbee"
echo ""
echo "You'll also need 'helm' and Kubernetes 'kubectl' installed."
echo "- Install Helm: https://helm.sh/docs/intro/install/"
echo "- Install kubectl: https://kubernetes.io/docs/tasks/tools/#kubectl"