-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
entrypoint.sh
38 lines (29 loc) · 957 Bytes
/
entrypoint.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
#!/bin/bash
set -e
echo "=============================================================================================="
echo "To check any other containers log,"
echo "run \"docker compose up --build --force-recreate --always-recreate-deps --renew-anon-volumes\""
echo "=============================================================================================="
readonly MAX_TRIES=120
attempt_num=0
until curl -I -s http://mysql-router-http:8080 -k >/dev/null; do
echo "Waiting for mysql router(http) ($attempt_num/$MAX_TRIES)"
sleep $((attempt_num++))
if ((attempt_num == MAX_TRIES)); then
exit 1
fi
done
attempt_num=0
until curl -I -s https://mysql-router-https:8443 -k >/dev/null; do
echo "Waiting for mysql router(https) ($attempt_num/$MAX_TRIES)"
sleep $((attempt_num++))
if ((attempt_num == MAX_TRIES)); then
exit 1
fi
done
echo "mysql router is ready."
#
# start go test
#
cd /go/src/mysqlrouter-go
go test -v .