summaryrefslogtreecommitdiffstats
path: root/policy-db-migrator/src/main
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2022-09-23 08:32:21 -0500
committerjhh <jorge.hernandez-herrero@att.com>2022-09-23 08:33:26 -0500
commit290376f7e211c20094aea740e863431ed77bf525 (patch)
treec720a6b90a38a566218ed88692379097511dbbd4 /policy-db-migrator/src/main
parent5864b946ba71e4f7e3a7cb5cc9fcb2ac03652c0c (diff)
Allow for mysql command flags in db-migrator
For example by setting the env var to MYSQL_CMD="mysql --ssl" Issue-ID: POLICY-4182 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: If7298fb2ea01f15324a526e49f2ec860d29f8d31
Diffstat (limited to 'policy-db-migrator/src/main')
-rwxr-xr-xpolicy-db-migrator/src/main/docker/db-migrator6
1 files changed, 5 insertions, 1 deletions
diff --git a/policy-db-migrator/src/main/docker/db-migrator b/policy-db-migrator/src/main/docker/db-migrator
index 565ff1c4..3a4ccfa0 100755
--- a/policy-db-migrator/src/main/docker/db-migrator
+++ b/policy-db-migrator/src/main/docker/db-migrator
@@ -621,7 +621,11 @@ if [ -z "${SQL_HOST}" ] || [ -z "${SQL_USER}" ] || [ -z "${SQL_PASSWORD}" ]; the
exit 4
fi
-MYSQL="mysql -u${SQL_USER} -p${SQL_PASSWORD} -h ${SQL_HOST}"
+if [ -z "$MYSQL_CMD" ]; then
+ MYSQL_CMD="mysql"
+fi
+
+MYSQL="${MYSQL_CMD} -u${SQL_USER} -p${SQL_PASSWORD} -h ${SQL_HOST}"
if ! ${MYSQL} -h"${SQL_HOST}" --execute "show databases;" >/dev/null 2>&1; then
echo "error: No DB connectivity to ${SQL_HOST} for ${SQL_USER}"
exit 5