Replace external health check with native one

Hopefully it will work more reliably.
parent 74759930
......@@ -3,6 +3,7 @@
set -ex
sudo docker run \
--health-cmd='mysqladmin ping --silent' \
-d \
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
-e MYSQL_DATABASE=doctrine_tests \
......@@ -10,4 +11,8 @@ sudo docker run \
--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
......@@ -5,6 +5,7 @@ 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 \
......@@ -12,4 +13,8 @@ sudo docker run \
--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
......@@ -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 \
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment