diff options
author | jhh <jorge.hernandez-herrero@att.com> | 2020-08-03 14:55:46 -0500 |
---|---|---|
committer | jhh <jorge.hernandez-herrero@att.com> | 2020-08-03 15:28:35 -0500 |
commit | e2d247088c6d675ebfa53689016053fc17918c81 (patch) | |
tree | 1ca2a34bee63fb0665113dff6f1ddf682f5814ff /packages | |
parent | af8ee06c648ee5fbc79b72d517e885f01cbb1f3b (diff) |
environment variables to support cert. store paths
Issue-ID: POLICY-2615
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I43f2a684590c5427051fa03bdf9ab0f73dab7085
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'packages')
-rw-r--r-- | packages/policy-api-docker/src/main/docker/policy-api.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/policy-api-docker/src/main/docker/policy-api.sh b/packages/policy-api-docker/src/main/docker/policy-api.sh index 81c5fe1c..c5eee15d 100644 --- a/packages/policy-api-docker/src/main/docker/policy-api.sh +++ b/packages/policy-api-docker/src/main/docker/policy-api.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x # # ============LICENSE_START======================================================= # Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. @@ -21,8 +21,10 @@ # JAVA_HOME=/usr/lib/jvm/java-11-openjdk/ -KEYSTORE="${POLICY_HOME}/etc/ssl/policy-keystore" -TRUSTSTORE="${POLICY_HOME}/etc/ssl/policy-truststore" +KEYSTORE="${KEYSTORE:-$POLICY_HOME/etc/ssl/policy-keystore}" +TRUSTSTORE="${TRUSTSTORE:-$POLICY_HOME/etc/ssl/policy-truststore}" +KEYSTORE_PASSWD="${KEYSTORE_PASSWD:-Pol1cy_0nap}" +TRUSTSTORE_PASSWD="${TRUSTSTORE_PASSWD:-Pol1cy_0nap}" if [ "$#" -eq 1 ]; then CONFIG_FILE=$1 @@ -39,12 +41,12 @@ echo "Policy api config file: $CONFIG_FILE" if [[ -f "${POLICY_HOME}"/etc/mounted/policy-truststore ]]; then echo "overriding policy-truststore" - cp -f "${POLICY_HOME}"/etc/mounted/policy-truststore "${TRUSTSTORE}" + cp -f "${POLICY_HOME}"/etc/mounted/policy-truststore "${TRUSTSTORE}" fi if [[ -f "${POLICY_HOME}"/etc/mounted/policy-keystore ]]; then echo "overriding policy-keystore" - cp -f "${POLICY_HOME}"/etc/mounted/policy-keystore "${KEYSTORE}" + cp -f "${POLICY_HOME}"/etc/mounted/policy-keystore "${KEYSTORE}" fi if [[ -f "${POLICY_HOME}"/etc/mounted/logback.xml ]]; then @@ -52,4 +54,4 @@ if [[ -f "${POLICY_HOME}"/etc/mounted/logback.xml ]]; then cp -f "${POLICY_HOME}"/etc/mounted/logback.xml "${POLICY_HOME}"/etc/ fi -$JAVA_HOME/bin/java -cp "${POLICY_HOME}/etc:${POLICY_HOME}/lib/*" -Dlogback.configurationFile=$POLICY_HOME/etc/logback.xml -Djavax.net.ssl.keyStore="$KEYSTORE" -Djavax.net.ssl.keyStorePassword="${KEYSTORE_PASSWD:-Pol1cy_0nap}" -Djavax.net.ssl.trustStore="$TRUSTSTORE" -Djavax.net.ssl.trustStorePassword="${TRUSTSTORE_PASSWD:-Pol1cy_0nap}" org.onap.policy.api.main.startstop.Main -c $CONFIG_FILE +$JAVA_HOME/bin/java -cp "${POLICY_HOME}/etc:${POLICY_HOME}/lib/*" -Dlogback.configurationFile="${POLICY_HOME}/etc/logback.xml" -Djavax.net.ssl.keyStore="${KEYSTORE}" -Djavax.net.ssl.keyStorePassword="${KEYSTORE_PASSWD}" -Djavax.net.ssl.trustStore="${TRUSTSTORE}" -Djavax.net.ssl.trustStorePassword="${TRUSTSTORE_PASSWD}" org.onap.policy.api.main.startstop.Main -c "${CONFIG_FILE}" |