Merge "update release version of modeling-etsicatalog"
[oom.git] / kubernetes / policy / charts / policy-common / resources / config / scripts / do-start.sh
index defae52..0e47310 100644 (file)
@@ -42,7 +42,7 @@ if [[ -f /opt/app/policy/etc/build.info ]]; then
        echo "Found existing installation, will not reinstall"
        . /opt/app/policy/etc/profile.d/env.sh
 
-else 
+else
        if [[ -d config ]]; then
                cp config/*.conf .
        fi
@@ -59,9 +59,15 @@ else
        . /opt/app/policy/etc/profile.d/env.sh
 
        # install keystore
-       #changed to use http instead of http, so keystore no longer needed
-       #cp config/policy-keystore.jks $POLICY_HOME/etc/ssl/policy-keystore
-       
+        # override the policy keystore and truststore if present
+       if [[ -f config/policy-keystore ]]; then
+               cp config/policy-keystore $POLICY_HOME/etc/ssl
+       fi
+
+       if [[ -f config/policy-truststore ]]; then
+               cp -f config/policy-truststore $[POLICY_HOME]/etc/ssl
+       fi
+
        if [[ -f config/$container-tweaks.sh ]] ; then
                # file may not be executable; running it as an
                # argument to bash avoids needing execute perms.
@@ -72,9 +78,18 @@ else
                # wait for DB up
                # now that DB is up, invoke database upgrade
                # (which does nothing if the db is already up-to-date)
-               dbuser=$(echo $(grep '^JDBC_USER=' base.conf | cut -f2 -d=))
-               dbpw=$(echo $(grep '^JDBC_PASSWORD=' base.conf | cut -f2 -d=))
-               db_upgrade_remote.sh $dbuser $dbpw {{.Values.global.mariadb.nameOverride}}
+               if [[ -v JDBC_USER ]]; then
+                       dbuser=${JDBC_USER};
+               else
+                       dbuser=$(echo $(grep '^JDBC_USER=' base.conf | cut -f2 -d=))
+               fi
+
+               if [[ -v JDBC_PASSWORD ]]; then
+                       dbpw=${JDBC_PASSWORD}
+               else
+                       dbpw=$(echo $(grep '^JDBC_PASSWORD=' base.conf | cut -f2 -d=))
+               fi
+               db_upgrade_remote.sh $dbuser $dbpw {{.Values.global.mariadb.service.name}}
        fi
 
 fi