-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.sh
executable file
·68 lines (53 loc) · 1.35 KB
/
deployment.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
60
#!/bin/bash
source ./scripts/wait_for_healthy.sh
source ./scripts/create_subscriptions.sh
ORION_HOST=localhost
ORION_PORT=$(grep ORION_PORT .env | cut -d '=' -f 2-)
if (( $# != 1 )); then
echo "Incorrect number of parameters"
echo "usage: ./deployment.sh [create|restart|stop|destroy]"
exit 1
fi
parameter="$1"
case "${parameter}" in
"create")
echo 'Starting containers...'
docker-compose up -d --build
wait_for orion
create_subscriptions
wait_for draco-1
echo 'Ready'
;;
"restart")
echo 'Restarting containers...'
docker-compose up -d --build
wait_for orion
wait_for draco-1
echo 'Ready'
;;
"stop")
echo 'Stopping...'
docker-compose down
echo 'Finish'
echo 'Command to restart: ./deployment.sh restart'
;;
"destroy")
echo 'Removing all...'
while true;
do
read -p "All the data will be deleted. Do you want to continue?" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
docker-compose down -v
echo 'Finish'
;;
*)
echo "Incorrect use of parameters"
echo "usage: ./deployment.sh [create|restart|stop|destroy]"
exit 1
;;
esac