Skip to content

Commit

Permalink
Replace external health check with native one
Browse files Browse the repository at this point in the history
Hopefully it will work more reliably.
  • Loading branch information
greg0ire committed Feb 28, 2020
1 parent 7fb5938 commit b18ec2a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion tests/travis/install-mariadb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
set -ex

sudo docker run \
--health-cmd='mysqladmin ping --silent' \
-d \
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
-e MYSQL_DATABASE=doctrine_tests \
-p 33306:3306 \
--name mariadb \
mariadb:${MARIADB_VERSION}

sudo docker exec -i mariadb bash <<< 'until echo \\q | mysql doctrine_tests > /dev/null 2>&1 ; do sleep 1; done'
until [ "$(sudo docker inspect --format "{{json .State.Health.Status }}" mariadb)" == "\"healthy\"" ]
do
echo "Waiting for MariaDB to become ready…"
sleep 1
done
7 changes: 6 additions & 1 deletion tests/travis/install-mysql-5.7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ set -ex
echo "Starting MySQL 5.7..."

sudo docker run \
--health-cmd='mysqladmin ping --silent' \
-d \
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
-e MYSQL_DATABASE=doctrine_tests \
-p 33306:3306 \
--name mysql57 \
mysql:5.7

sudo docker exec -i mysql57 bash <<< 'until echo \\q | mysql doctrine_tests > /dev/null 2>&1 ; do sleep 1; done'
until [ "$(sudo docker inspect --format "{{json .State.Health.Status }}" mysql57)" == "\"healthy\"" ]
do
echo "Waiting for MySQL to become ready…"
sleep 1
done
7 changes: 6 additions & 1 deletion tests/travis/install-mysql-8.0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ echo "Starting MySQL 8.0..."

sudo docker pull mysql:8.0
sudo docker run \
--health-cmd='mysqladmin ping --silent' \
-d \
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
-e MYSQL_DATABASE=doctrine_tests \
Expand All @@ -14,4 +15,8 @@ sudo docker run \
mysql:8.0 \
--default-authentication-plugin=mysql_native_password

sudo docker exec -i mysql80 bash <<< 'until echo \\q | mysql doctrine_tests > /dev/null 2>&1 ; do sleep 1; done'
until [ "$(sudo docker inspect --format "{{json .State.Health.Status }}" mysql80)" == "\"healthy\"" ]
do
echo "Waiting for MySQL to become ready…"
sleep 1
done

0 comments on commit b18ec2a

Please sign in to comment.