mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-22 18:20:12 +01:00
Poll for the database to be up before running tests
This commit is contained in:
parent
9f65d809da
commit
49bc3eb0cd
2 changed files with 19 additions and 1 deletions
12
script/poll-for-db
Executable file
12
script/poll-for-db
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
appdir=$(cd $(dirname "$0")/.. && pwd)
|
||||
[ -f /etc/app-env ] || exec "$appdir/script/docker-environment" $0 $@
|
||||
|
||||
for i in {1..60}; do
|
||||
curl -sf db:3306 >/dev/null && exit
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "Unable to reach database!"
|
||||
exit 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue