-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev.sh
executable file
·33 lines (27 loc) · 1.03 KB
/
dev.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
#!/bin/bash
# If redeploy is given as an argument
# run k3s-uninstall, then regardless of outcome, run cleanip, then run cargo run -- install
if [ "$1" == "redeploy" ]; then
k3s-uninstall.sh
cleanip
cargo run -- install
elif [ "$1" == "cleanredeploy" ]; then
# Remove the existing server data
sudo rm -rf /var/lib/dragonfly/
k3s-uninstall.sh
cleanip
cargo run -- install
elif [ "$1" == "server" ]; then
# Spin down Dragonfly's statefulset so we can replace it temporarily
KUBECONFIG=k3s.yaml kubectl scale statefulset dragonfly --replicas=0 -n tink
# Spin up the web ui
KUBECONFIG=k3s.yaml cargo run -- server
elif [ "$1" == "cleanserver" ]; then
# Spin down Dragonfly's statefulset so we can replace it temporarily
KUBECONFIG=k3s.yaml kubectl scale statefulset dragonfly --replicas=0 -n tink
# Remove the existing server data
sudo chown -R $(whoami):$(whoami) /var/lib/dragonfly
rm -rf /var/lib/dragonfly/*
# Spin up the web ui
KUBECONFIG=k3s.yaml cargo run -- server
fi