From c34da31922d20ae675a5de6bc5c251598ae71ff5 Mon Sep 17 00:00:00 2001 From: jhh Date: Mon, 9 Aug 2021 19:54:55 -0500 Subject: Add SQL_PORT configuration Issue-ID: POLICY-3533 Change-Id: I03fc41332d4739d5a4d6cee5f86ba823714336d6 Signed-off-by: jhh --- packages/docker/src/main/docker/pdpd-entrypoint.sh | 8 ++++++-- packages/install/src/files/base.conf | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'packages') diff --git a/packages/docker/src/main/docker/pdpd-entrypoint.sh b/packages/docker/src/main/docker/pdpd-entrypoint.sh index 8f801a45..112d3cb4 100644 --- a/packages/docker/src/main/docker/pdpd-entrypoint.sh +++ b/packages/docker/src/main/docker/pdpd-entrypoint.sh @@ -154,8 +154,12 @@ function db { return 0 fi - echo "Wating for ${SQL_HOST} ." - timeout 120 sh -c 'until nc -vz "${SQL_HOST}" 3306; do echo -n "."; sleep 1; done'; echo $? + if [ -z "${SQL_PORT}" ]; then + export SQL_PORT=3306 + fi + + echo "Waiting for ${SQL_HOST}:${SQL_PORT} ..." + timeout 120 sh -c 'until nc -vz -w 20 "${SQL_HOST}" "${SQL_PORT}"; do echo -n "."; sleep 1; done' "${POLICY_HOME}"/bin/db-migrator -s ALL -o upgrade } diff --git a/packages/install/src/files/base.conf b/packages/install/src/files/base.conf index d6b38d10..bf9b72ea 100644 --- a/packages/install/src/files/base.conf +++ b/packages/install/src/files/base.conf @@ -72,6 +72,7 @@ REPOSITORY_OFFLINE= SQL_HOST= SQL_USER= SQL_PASSWORD= +SQL_PORT=3306 # AAF -- cgit 1.2.3-korg