File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,34 @@ function waitForService()
2727 printf " service is online %s:%s\n" $1 $2
2828}
2929
30+ function waitForServiceLocalStack()
31+ {
32+ waitForService localstack 4566 $1
33+
34+ ATTEMPTS=0
35+ RESPONSE=' '
36+ READY=0
37+ until [ $READY = 1 ]; do
38+ printf " check readiness for service localstack:4566\n"
39+ RESPONSE=$( curl -s http://localstack:4566/_localstack/health)
40+ if [[ $RESPONSE == * ' "sns": "running"' * && $RESPONSE == * ' "sqs": "running"' * ]]; then
41+ READY=1
42+ fi
43+ (( ATTEMPTS++ ))
44+ if [ $ATTEMPTS -ge $2 ]; then
45+ printf " service is not ready localstack:4566\n"
46+ exit 1
47+ fi
48+ if [ " $FORCE_EXIT " = true ]; then
49+ exit ;
50+ fi
51+
52+ sleep 1
53+ done
54+
55+ printf " service is ready localstack:4566\n"
56+ }
57+
3058trap " FORCE_EXIT=true" SIGTERM SIGINT
3159
3260waitForService rabbitmq 5672 50
@@ -39,7 +67,7 @@ waitForService gearmand 4730 50
3967waitForService kafka 9092 50
4068waitForService mongo 27017 50
4169waitForService thruway 9090 50
42- waitForService localstack 4566 50
70+ waitForServiceLocalStack 50 50
4371
4472php docker/bin/refresh-mysql-database.php || exit 1
4573php docker/bin/refresh-postgres-database.php || exit 1
You can’t perform that action at this time.
0 commit comments