File tree 1 file changed +29
-1
lines changed
1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,34 @@ function waitForService()
27
27
printf " service is online %s:%s\n" $1 $2
28
28
}
29
29
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
+
30
58
trap " FORCE_EXIT=true" SIGTERM SIGINT
31
59
32
60
waitForService rabbitmq 5672 50
@@ -39,7 +67,7 @@ waitForService gearmand 4730 50
39
67
waitForService kafka 9092 50
40
68
waitForService mongo 27017 50
41
69
waitForService thruway 9090 50
42
- waitForService localstack 4566 50
70
+ waitForServiceLocalStack 50 50
43
71
44
72
php docker/bin/refresh-mysql-database.php || exit 1
45
73
php docker/bin/refresh-postgres-database.php || exit 1
You can’t perform that action at this time.
0 commit comments