-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor MySQL and MariaDB run in a single script
- Loading branch information
Showing
6 changed files
with
55 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
echo "Starting RDBMS…" | ||
|
||
if [[ "$IMAGE" == "mysql:8.0" ]] | ||
then | ||
CMD_OPTIONS="--default-authentication-plugin=mysql_native_password" | ||
else | ||
CMD_OPTIONS="" | ||
fi | ||
|
||
sudo docker run \ | ||
--health-cmd='mysqladmin ping --silent' \ | ||
--detach \ | ||
--env MYSQL_ALLOW_EMPTY_PASSWORD=yes \ | ||
--env MYSQL_DATABASE=doctrine_tests \ | ||
--publish 33306:3306 \ | ||
--name rdbms \ | ||
"$IMAGE" $CMD_OPTIONS | ||
|
||
until [ "$(sudo docker inspect --format "{{json .State.Health.Status }}" rdbms)" == "\"healthy\"" ] | ||
do | ||
if [ "$(sudo docker inspect --format "{{json .State.Health.Status }}" rdbms)" == "\"unhealthy\"" ] | ||
then | ||
echo "Container is unhealthy" | ||
exit 1 | ||
fi | ||
echo "Waiting for RDBMS to become ready…" | ||
sleep 1 | ||
done |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.