File: entrypoint.sh

package info (click to toggle)
golang-github-rluisr-mysqlrouter-go 1.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 264 kB
  • sloc: sh: 215; javascript: 15; makefile: 11
file content (38 lines) | stat: -rw-r--r-- 957 bytes parent folder | download
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
#!/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 .