diff options
author | jhh <jorge.hernandez-herrero@att.com> | 2021-08-09 19:54:55 -0500 |
---|---|---|
committer | jhh <jorge.hernandez-herrero@att.com> | 2021-08-10 12:23:13 -0500 |
commit | c34da31922d20ae675a5de6bc5c251598ae71ff5 (patch) | |
tree | bbc155f6d07ee3609b0780f6c81e412194830f8e /packages/docker | |
parent | 2416b2db724a187001830d4573b888f8367b37a4 (diff) |
Add SQL_PORT configuration
Issue-ID: POLICY-3533
Change-Id: I03fc41332d4739d5a4d6cee5f86ba823714336d6
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'packages/docker')
-rw-r--r-- | packages/docker/src/main/docker/pdpd-entrypoint.sh | 8 |
1 files changed, 6 insertions, 2 deletions
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 } |