-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-minikube.sh
executable file
·42 lines (36 loc) · 1 KB
/
install-minikube.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
#!/bin/bash
set -e
HERE=$(dirname "$(readlink -f "$0")")
. "$HERE/utils/versions.sh"
if [ "$EUID" -ne 0 ]; then
echo "Run this script as root"
exit 1
fi
fetch () {
local NAME=$1
local URL=$2
local EXEC="/usr/bin/$NAME"
if [ ! -f "$EXEC" ]; then
wget -O "$EXEC" "$URL"
chmod +x "$EXEC"
fi
}
fetch_tarball ()
{
local NAME=$1
local URL=$2
local DIR=$3
local EXEC="/usr/bin/$NAME"
if [ ! -f "$EXEC" ]; then
cd /tmp
rm --force kube.tgz
wget -O kube.tgz "$URL"
tar xf kube.tgz "$DIR/$NAME"
chmod +x "$DIR/$NAME"
mv "$DIR/$NAME" /usr/bin
rm --force --recursive kube.tgz "$DIR"
fi
}
fetch kubectl "https://storage.googleapis.com/kubernetes-release/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl"
fetch minikube "https://storage.googleapis.com/minikube/releases/v$MINIKUBE_VERSION/minikube-linux-amd64"
fetch_tarball minishift "https://github.com/minishift/minishift/releases/download/v$MINISHIFT_VERSION/minishift-$MINISHIFT_VERSION-linux-amd64.tgz" "minishift-$MINISHIFT_VERSION-linux-amd64"