-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev_deploy.sh
More file actions
executable file
·62 lines (52 loc) · 1.24 KB
/
Copy pathdev_deploy.sh
File metadata and controls
executable file
·62 lines (52 loc) · 1.24 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
# deploy the database backend
(cd store && docker-compose up -d)
DB_LIVE=false
TIMEOUT=0
while [ "$DB_LIVE" = "false" ] && [ "$TIMEOUT" -lt 10 ]
do
if lsof -Pi :5432 -sTCP:LISTEN -t >/dev/null ; then
DB_LIVE=true
echo 'The database is live'
else
echo 'Waiting'
TIMEOUT=$TIMEOUT + 1
sleep 1.0
fi
done
if [[ $TIMEOUT -gt 9 ]] ; then
echo 'The database failed to deploy'
fi
ADMIN_LIVE=false
TIMEOUT=0
while [ "$ADMIN_LIVE" = "false" ] && [ "$TIMEOUT" -lt 10 ]
do
if lsof -Pi :5050 -sTCP:LISTEN -t >/dev/null ; then
ADMIN_LIVE=true
echo 'The database admin panel is live'
else
echo 'Waiting'
TIMEOUT=$TIMEOUT + 1
sleep 1.0
fi
done
if [[ $TIMEOUT -gt 9 ]] ; then
echo 'The database admin panel failed to deploy'
fi
# Bring up proxy
docker-compose up -d
PROXY_LIVE=false
TIMEOUT=0
while [ "$PROXY_LIVE" = "false" ] && [ "$TIMEOUT" -lt 10 ]
do
if curl -s 'http://localhost/pgadmin' > /dev/null ; then
PROXY_LIVE=true
echo 'The reverse proxy is live'
else
echo 'Waiting on reverse proxy'
TIMEOUT=$(($TIMEOUT + 1))
sleep 1.0
fi
done
if [[ $TIMEOUT -gt 9 ]] ; then
echo 'Reverse proxy failed to deploy'
fi