forked from FAForever/db
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
27 lines (25 loc) · 671 Bytes
/
test.sh
File metadata and controls
27 lines (25 loc) · 671 Bytes
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
#!/bin/bash
set -e
echo -e 'travis_fold:start:docker'
echo '# Build & Run Docker Container'
docker build -t faf-db .
docker run -d --name faf-db -e MYSQL_ROOT_PASSWORD=banana -p 3306:3306 faf-db
echo 'wait on faf-db ...'
counter=1
# wait 5 minutes on docker container
while [ $counter -le 300 ]
do
status=$(docker inspect --format='{{json .State.Health.Status}}' faf-db)
expected='"healthy"'
if [ $status == $expected ]; then
echo '... faf-db is running'
echo -en 'travis_fold:end:docker\\r'
exit 0
fi
sleep 1
((counter++))
done
docker logs faf-db
echo '... faf-db is not running'
echo -e 'travis_fold:end:docker'
exit 1