From 36be7524d6902d9ecf638c1b069d597b28a65823 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Fri, 8 Dec 2023 14:27:02 +0100 Subject: [PATCH] HHH-17538 Update MariaDB CI testing to 11.3 --- docker_db.sh | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/docker_db.sh b/docker_db.sh index 14df639933..1bafd11d00 100755 --- a/docker_db.sh +++ b/docker_db.sh @@ -92,7 +92,7 @@ mysql_8_2() { } mariadb() { - mariadb_11_1 + mariadb_11_3 } mariadb_10_4() { @@ -164,6 +164,29 @@ mariadb_11_1() { fi } +mariadb_11_3() { + $CONTAINER_CLI rm -f mariadb || true + $CONTAINER_CLI run --name mariadb -e MYSQL_USER=hibernate_orm_test -e MYSQL_PASSWORD=hibernate_orm_test -e MYSQL_DATABASE=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -p3306:3306 -d docker.io/mariadb:11.3.1-rc --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --skip-character-set-client-handshake + OUTPUT= + n=0 + until [ "$n" -ge 5 ] + do + # Need to access STDERR. Thanks for the snippet https://stackoverflow.com/a/56577569/412446 + { OUTPUT="$( { $CONTAINER_CLI logs mariadb; } 2>&1 1>&3 3>&- )"; } 3>&1; + if [[ $OUTPUT == *"ready for connections"* ]]; then + break; + fi + n=$((n+1)) + echo "Waiting for MariaDB to start..." + sleep 3 + done + if [ "$n" -ge 5 ]; then + echo "MariaDB failed to start and configure after 15 seconds" + else + echo "MariaDB successfully started" + fi +} + postgresql() { postgresql_15 } @@ -911,6 +934,7 @@ if [ -z ${1} ]; then echo -e "\tedb_12" echo -e "\thana" echo -e "\tmariadb" + echo -e "\tmariadb_11_3" echo -e "\tmariadb_11_1" echo -e "\tmariadb_10_9" echo -e "\tmariadb_10_4"