-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathminikube-run.sh
More file actions
executable file
·47 lines (42 loc) · 1.3 KB
/
minikube-run.sh
File metadata and controls
executable file
·47 lines (42 loc) · 1.3 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
46
47
#!/bin/bash
if ! [ -x "$(command -v docker)" ]; then
echo 'Error: docker is not installed. Please install it first.' >&2
exit 1
fi
if ! [ -x "$(command -v minikube)" ]; then
echo 'Error: minikube is not installed. Please install it first.' >&2
exit 1
fi
if ! [ -x "$(command -v kubectl)" ]; then
echo 'Error: kubectl is not installed. Please install it first.' >&2
exit 1
fi
minikubestatus=$(minikube status -f "{{.Host}}")
if [[ $minikubestatus != *"Running"* ]]; then
echo "Minikube is not running; please start with at least 15GB ram and 6 cores assigned."
exit 1
fi
echo "➡️ Building Java..."
./gradlew
echo "➡️ Building docker images..."
cd docker || exit
docker compose build
cd .. || exit
echo "➡️ Removing old kubernetes namespaces (if they exist)..."
kubectl delete ns aeron-io-sample-cluster
kubectl delete ns aeron-io-sample-admin
kubectl delete ns aeron-io-sample-backup
echo "➡️ Loading docker images into minikube..."
minikube image load admin:latest
minikube image load cluster:latest
minikube image load backup:latest
echo "➡️ Applying admin..."
cd ./kubernetes/admin || exit
kubectl apply -f .
echo "➡️ Applying cluster..."
cd ../cluster || exit
kubectl apply -f .
echo "➡️ Applying cluster backup..."
cd ../backup || exit
kubectl apply -f .
echo "➡️ Done"