From: Benjamin Diaz Date: Mon, 11 Mar 2019 16:36:34 +0000 (-0300) Subject: Adds support in entrypoint script for more complex mysql URI (+pool and query params) X-Git-Tag: v6.0.0~11 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F89%2F7289%2F1;p=osm%2FPOL.git Adds support in entrypoint script for more complex mysql URI (+pool and query params) Change-Id: Iab6bd86196d9b0bf330eac6b053fdda5dc021328 Signed-off-by: Benjamin Diaz --- diff --git a/docker/scripts/start.sh b/docker/scripts/start.sh index 04d0d34..3209824 100644 --- a/docker/scripts/start.sh +++ b/docker/scripts/start.sh @@ -37,11 +37,11 @@ function is_db_created() { } if [[ $OSMPOL_SQL_DATABASE_URI == *'mysql'* ]]; then - DB_HOST=$(echo $OSMPOL_SQL_DATABASE_URI | sed -r 's|^\w+://.+:.+@(.+):.*$|\1|') - DB_PORT=$(echo $OSMPOL_SQL_DATABASE_URI | sed -r 's|^\w+://.*:([0-9]+).*$|\1|') - DB_USER=$(echo $OSMPOL_SQL_DATABASE_URI | sed -r 's|^\w+://(.+):.+@.+$|\1|') + DB_HOST=$(echo $OSMPOL_SQL_DATABASE_URI | sed -r 's|^.+://.+:.+@(.+):.*$|\1|') + DB_PORT=$(echo $OSMPOL_SQL_DATABASE_URI | sed -r 's|^.+://.*:([0-9]+).*$|\1|') + DB_USER=$(echo $OSMPOL_SQL_DATABASE_URI | sed -r 's|^.+://(.+):.+@.+$|\1|') DB_PASSWORD=$(echo $OSMPOL_SQL_DATABASE_URI | sed -r 's|^.+://.+:(.+)@.*$|\1|') - DB_NAME=$(echo $OSMPOL_SQL_DATABASE_URI | sed -r 's|^\w+://.+:.+@.+:.*/(.+)$|\1|') + DB_NAME=$(echo $OSMPOL_SQL_DATABASE_URI | sed -r 's|^.+://.+:.+@.+:.*/(\w+)(\?.*)?$|\1|') wait_db "$DB_HOST" "$DB_PORT" || exit 1