forked from hydroshare/hydroshare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
slow-start.sh
executable file
·48 lines (39 loc) · 1.56 KB
/
slow-start.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
#!/bin/bash
machine="`uname -s`"
case "$machine" in
Linux*) export SED_EXT='' ;;
Darwin*) export SED_EXT='""' ;;
*) export SED_EXT='' ;;
esac
echo
echo '########################################################################################################################'
echo " Starting system"
echo '########################################################################################################################'
echo
docker-compose -f local-dev.yml up -d
echo
echo '########################################################################################################################'
echo " Waiting for iRODS containers up"
echo '########################################################################################################################'
echo
COUNT=0
SECOND=0
while [ $COUNT -lt 2 ]
do
DATA=`docker $DOCKER_PARAM logs data.local.org 2>/dev/null | grep 'Success'`
if [ "$DATA" != "" ]; then
COUNT=$(($COUNT + 1))
fi
USER=`docker $DOCKER_PARAM logs users.local.org 2>/dev/null | grep 'Success'`
if [ "$USER" != "" ]; then
COUNT=$(($COUNT + 1))
fi
SECOND=$(($SECOND + 1))
echo -ne "$SECOND ...\033[0K\r" && sleep 1;
done
echo
echo '########################################################################################################################'
echo -e " Restart defaultworker to make sure it is able to connect to iRODS containers"
echo '########################################################################################################################'
echo
docker restart defaultworker hydroshare