-
Notifications
You must be signed in to change notification settings - Fork 0
/
reinstall.sh
59 lines (45 loc) · 1.65 KB
/
reinstall.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
#!/bin/bash
# ==================== COMMANDS ====================
# 🚀 Reinstall only deployments
# bash ./reinstall.sh
# 🔄 Reinstall everything (delete Minikube and reinstall)
# bash ./reinstall.sh --full
# 🗑️ Reinstall only MongoDB
# bash ./reinstall.sh --mongodb
# 🗑️ Reinstall only GitLab
# bash ./reinstall.sh --gitlab
# 🗑️ Reinstall only MinIO
# bash ./reinstall.sh --minio
# ==================== SCRIPT LOGIC ====================
# Check for the first argument to determine the action
if [ "$1" = "--full" ]; then
echo "🗑️ Deleting Minikube and reinstalling everything.."
minikube delete # Delete the Minikube cluster
# Restart the installation process
bash ./start.sh
bash ./install.sh
# Check for MongoDB reinstallation
elif [ "$1" = "--mongodb" ]; then
echo "🔄 Reinstalling only MongoDB.."
bash ./mongodb/uninstall.sh # Uninstall MongoDB
bash ./mongodb/setup.sh # Setup MongoDB
# Check for MinIO reinstallation
elif [ "$1" = "--minio" ]; then
echo "🔄 Reinstalling only MinIO.."
bash ./minio/uninstall.sh # Uninstall MinIO
bash ./minio/setup.sh # Setup MinIO
# Check for GitLab reinstallation
elif [ "$1" = "--gitlab" ]; then
echo "🔄 Reinstalling only GitLab.."
bash ./gitlab/uninstall.sh # Uninstall GitLab
bash ./gitlab/setup.sh # Setup GitLab
# If no valid argument is provided, reinstall deployments
else
echo "🔄 Reinstalling only deployments.."
# Uninstall all services
bash ./mongodb/uninstall.sh
bash ./minio/uninstall.sh
bash ./gitlab/uninstall.sh
# Install all services again
bash ./install.sh
fi