-
Notifications
You must be signed in to change notification settings - Fork 60
/
install.sh
executable file
·59 lines (52 loc) · 2.06 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
59
#!/usr/bin/env bash
# Get cpu and memory specs
cpu_count=$(cat /proc/cpuinfo | grep 'processor.*: [[:digit:]]$' | wc -l)
memory=$(($(cat /proc/meminfo | grep MemTotal | cut -f 2 -d : | tr -d " kB") / 1024))
# Download and install minikube
if [ -x /usr/local/bin/minikube ]; then
echo "Minikube already installed"
# TODO: Check for upgrades
else
echo Downloading minikube...
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
echo
echo Installing minikube. You will be asked for sudo password.
sudo install minikube-linux-amd64 /usr/local/bin/minikube
fi
# Install bonfire
pip3 show crc-bonfire 2>/dev/null >/dev/null
if [ $? != "0" ]; then
echo Installing Bonfire...
echo
pip3 install --user --upgrade crc-bonfire
fi
# Install git precommit hook
HOOKDIR=".git/hooks"
mkdir -p "$HOOKDIR"
cp -r githooks/* "$HOOKDIR/"
chmod +x "$HOOKDIR/"*
echo "Githooks installed"
# Start minikube based on specs
minikube status 2>/dev/null >/dev/null
if [ $? != "0" ]; then
echo Starting Minikube...
echo
cmd="minikube start --cpus=$(($cpu_count / 2)) --memory $(($memory / 2))MB --addons=registry --addons=ingress --driver=kvm2 --addons=metrics-server --disable-optimizations"
echo $cmd
$cmd
fi
echo Installing Clowder into Minikube...
echo
# TODO: Create a "latest" release and use it instead
minikube kubectl -- apply --validate=false -f https://github.com/RedHatInsights/clowder/releases/download/0.12.0/clowder-manifest-0.12.0.yaml
echo Installing ClowdEnvironment...
# TODO: Configure way to install pull secret
# TODO: NodePort config
bonfire process-env --clowd-env test 2>/dev/null | minikube kubectl -- apply --validate=false -f -
echo Creating test namespace...
minikube kubectl create ns test
echo Installing apps...
# TODO: Set up app dependencies such that only one app needs to be listed
bonfire process --clowd-env=test host-inventory ingress engine 2>/dev/null | minikube kubectl -- apply --validate=false -n test -f -
# TODO: Use 'minikube service' to get a URL(s) to the apps
# TODO: Install UI + keycloak