X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=misc%2Fdmaapbc;h=aca8f9e0dd6f37a8b93bb1fed30cd33025016f2a;hb=53eef7bbc76b4443877e5ab4a1bd10083335e41e;hp=0dff4d6c3ac49869939b1ae31c7391fe3b7155ba;hpb=6350b1e1587249643371cbb5f1f91e7fb1317587;p=dmaap%2Fbuscontroller.git diff --git a/misc/dmaapbc b/misc/dmaapbc index 0dff4d6..aca8f9e 100644 --- a/misc/dmaapbc +++ b/misc/dmaapbc @@ -31,8 +31,9 @@ PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/java/jdk/ export PATH CLASSPATH=`echo $APP_ROOT/etc $APP_ROOT/lib/*.jar | tr ' ' ':'` export CLASSPATH -CONFIGMAP_ROOT=/opt/app/config -CONTAINER_CONFIG=$CONFIGMAP_ROOT/conf +CONFIGMAP_ROOT=${CONFIGMAP_ROOT:-/opt/app/config} +CONFIGMAP_PROPS=${CONFIGMAP_PROPS:-$CONFIGMAP_ROOT/conf/dmaapbc.properties} +CONTAINER_CONFIG=$CONFIGMAP_ROOT/conf/buscontroller.env MAIN=org.onap.dmaap.dbcapi.server.Main @@ -44,6 +45,7 @@ pids() { } config() { + echo "ENTER config" set -x if [ ! -d $APP_ROOT ] then @@ -52,8 +54,8 @@ config() { fi if [ ! -f $CONTAINER_CONFIG ] then - echo "Expected env file $CONTAINER_CONFIG not found" - exit 1 + echo "WARNING: Expected env file $CONTAINER_CONFIG not found. Default behaviors in effect" + find $CONTAINER_ROOT -type f fi cd $APP_ROOT source $CONTAINER_CONFIG @@ -76,10 +78,13 @@ config() { chmod +x etc/havecert # These files might be better provided in kubernetes configmaps - # so if they are already there, don't overwrite. - if [ ! -f etc/dmaapbc.properties ] + # so if they are there, use them + if [ -f $CONFIGMAP_PROPS ] then - . misc/dmaapbc.properties.tmpl > etc/dmaapbc.properties + PROPS=$CONFIGMAP_PROPS + else + PROPS=etc/dmaapbc.properties + . misc/dmaapbc.properties.tmpl > $PROPS fi if [ ! -f config/PolicyEngineApi.properties ] then @@ -89,6 +94,7 @@ config() { } start() { + echo "ENTER start" set -x ID=`id -n -u` GRP=`id -n -g` @@ -103,6 +109,7 @@ start() { exit 1 fi cd $APP_ROOT + pwd if etc/havecert then @@ -121,7 +128,7 @@ start() { # JVM flags #old line from Dockerfile...keep for reference only - FLAGS="-cp etc:lib/* -Dlog4j.configuration=etc/log4j.properties -Ddmaapbc.properties=etc/dmaapbc.properties -Dlogback.configurationFile=etc/logback.xml -Dhttps.protocols=TLSv1.2 -Dhttps.cipherSuites=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" + FLAGS="-cp etc:lib/* -Dlog4j.configuration=etc/log4j.properties -DConfigFile=$PROPS -Dlogback.configurationFile=etc/logback.xml -Dhttps.protocols=TLSv1.2 -Dhttps.cipherSuites=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" #nohup java $FLAGS $MAIN /dev/null 2>&1 & nohup java $FLAGS $MAIN