summaryrefslogtreecommitdiffstats
path: root/packages/policy-pap-docker/src/main/docker
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2020-08-03 15:18:59 -0500
committerjhh <jorge.hernandez-herrero@att.com>2020-08-03 15:29:20 -0500
commite32cb0265d6950c10a7512868846feeee95f9434 (patch)
treed614671a6f5542a57a18802e3268878215e03ef7 /packages/policy-pap-docker/src/main/docker
parentf59bfe6e34ea3d9f5b5dd80bdabdce0216fd4349 (diff)
environment variables to support cert. store paths
Issue-ID: POLICY-2615 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I077bd1b8ff30b0d0ac620dab37a24cbe7776ca15 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'packages/policy-pap-docker/src/main/docker')
-rw-r--r--packages/policy-pap-docker/src/main/docker/policy-pap.sh15
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/policy-pap-docker/src/main/docker/policy-pap.sh b/packages/policy-pap-docker/src/main/docker/policy-pap.sh
index 0dba845f..cfcf6aaa 100644
--- a/packages/policy-pap-docker/src/main/docker/policy-pap.sh
+++ b/packages/policy-pap-docker/src/main/docker/policy-pap.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -x
#
# ============LICENSE_START=======================================================
# Copyright (C) 2019-2020 Nordix Foundation.
@@ -21,9 +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 [ "$#" -ge 1 ]; then
CONFIG_FILE=$1
@@ -40,12 +41,12 @@ echo "Policy pap 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
@@ -53,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.pap.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.pap.main.startstop.Main -c "${CONFIG_FILE}"