forked from sqshq/piggymetrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·57 lines (50 loc) · 1.45 KB
/
run.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
#!/bin/bash
echo "Config must run first (see ./config/run.sh)"
echo "-------------------------------------------"
echo "Getting environment variables from /.env"
echo "Available params: "
echo " --dev -> development. Default (production)"
echo " --debug -> execute docker-compose not in daemon, so you can see logs"
password = "43694524"
export set CONFIG_SERVICE_PASSWORD=$password
export set NOTIFICATION_SERVICE_PASSWORD=$password
export set STATISTICS_SERVICE_PASSWORD=$password
export set ACCOUNT_SERVICE_PASSWORD=$password
export set MONGODB_PASSWORD=$password
read -p "When Config is ready, press any key to continue... " -n1 -s
dev=false
debug=false
while [[ ${1} ]]; do
case "${1}" in
--dev)
dev=true #${2}
shift
;;
--debug)
debug=true #${2}
shift
;;
*)
echo "Unknown parameter: ${1}" >&2
return 1
esac
#if ! shift; then
# echo 'Missing parameter argument.' >&2
# return 1
#fi
done
if $dev ; then
echo "Executing --dev"
if $debug ; then
echo "Executing --debug"
sudo docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
else
sudo docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
sudo service docker status
fi
else
echo "Executing --prod"
sudo docker-compose up -d
sudo service docker status
echo "execute docker-compose down to stop all containers"
fi