-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path01cloud
More file actions
executable file
·98 lines (97 loc) · 2.98 KB
/
01cloud
File metadata and controls
executable file
·98 lines (97 loc) · 2.98 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
if [ "$1" == "install" ]
then
if [ -z "$KUBECONFIG" ]
then
export KUBECONFIG=~/.kube/config
fi
sudo --preserve-env=KUBECONFIG bash helper/install.sh $2 $3
elif [ "$1" == "setup" ]
then
bash helper/setup.sh $2 $3
elif [ "$1" == "host" ]
then
if [ -z "$KUBECONFIG" ]
then
export KUBECONFIG=~/.kube/config
fi
echo "You need sudo access to perform this action"
sudo --preserve-env=KUBECONFIG bash helper/host.sh $2
printf "\nRun './01cloud --help' for more options\n"
elif [ "$1" == "dbseed" ]
then
bash seeder/seeder.sh
elif [ "$1" == "dbrun" ]
then
kubectl apply -f helper/db_services.yaml
if [ "$2" == "rwx" ]
then
kubectl apply -f helper/pvc_rwx.yaml
else
kubectl apply -f helper/pvc_rwo.yaml
fi
sleep 5
printf "\nRun './01cloud --help' for more options\n"
elif [ "$1" == "dbstop" ]
then
skaffold delete
sleep 2
kubectl delete -f helper/db_services.yaml
printf "\nRun './01cloud --help' for more options\n"
elif [ "$1" == "clone" ]
then
bash helper/clone.sh
elif [ "$1" == "deploy" ]
then
skaffold deploy
elif [ "$1" == "build" ]
then
source helper/create_session.sh
skaffold build
elif [ "$1" == "dev" ]
then
source helper/create_session.sh
skaffold dev
elif [ "$1" == "run" ]
then
source helper/create_session.sh
skaffold run
printf "\nRun './01cloud --help' for more options\n"
elif [ "$1" == "stop" ]
then
skaffold delete
printf "\nRun './01cloud --help' for more options\n"
elif [ "$1" == "clean" ]
then
skaffold delete
sleep 2
kubectl delete -f helper/db_services.yaml
bash helper/cleanup_setup.sh
printf "\nRun './01cloud --help' for more options\n"
else
echo "Usage:"
echo " ./01cloud [command]"
echo ""
echo "Available Commands:"
echo " install [env [mode]] setup and install the 01cloud service into the cluster."
echo " env - local(default) / remote"
echo " mode - rwo(default) / rwx"
echo " setup [env [mode]] install required packages into the cluster."
echo " env - local(default) / remote"
echo " mode - rwo(default) / rwx"
echo ""
echo " dbrun [mode] install database instances in the cluster with pvc volumes."
echo " mode - rwo(default) / rwx"
echo ""
echo " host [option] add host into /etc/hosts/ location."
echo " option - add(default) / remove"
echo ""
echo " run execute scaffold run command to build and deploy 01cloud."
echo " dbseed import sample data into database for preparing 01cloud environment."
echo " stop stop and terminate services started by dev/run/deploy command."
echo " dbstop stop and terminate all the service including pvc and database instances."
echo " dev start scaffold with dev environemnt."
echo " build build the image with skaffold."
echo " deploy deploy 01cloud with default settings."
echo " clean remove all the setup and deployed services."
fi