X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fbin%2Fstart.sh;h=d68d6c842cd857b8999a12ff01c49c8291cd2c98;hb=HEAD;hp=00d7dd62ce12230c98dc766cc633838761706080;hpb=66b3afa06776e9944ad515206d281d67747c9770;p=aai%2Fbabel.git diff --git a/src/main/bin/start.sh b/src/main/bin/start.sh index 00d7dd6..d68d6c8 100644 --- a/src/main/bin/start.sh +++ b/src/main/bin/start.sh @@ -3,8 +3,8 @@ # ============LICENSE_START======================================================= # org.onap.aai # ================================================================================ -# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. -# Copyright © 2017-2018 European Software Marketing Ltd. +# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2019 European Software Marketing Ltd. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,44 +19,40 @@ # limitations under the License. # ============LICENSE_END========================================================= -BASEDIR="/opt/app/babel/" -AJSC_HOME="$BASEDIR" +APP_HOME="${APP_HOME:-/opt/app/babel}" +mkdir -p ${APP_HOME}/logs/gc -if [ -z "$CONFIG_HOME" ]; then - echo "CONFIG_HOME must be set in order to start up process" +if [ -z "${CONFIG_HOME}" ]; then + echo "CONFIG_HOME must be set in order to start the process" exit 1 fi -foo () { -if [ -z "$KEY_STORE_PASSWORD" ]; then - echo "KEY_STORE_PASSWORD must be set in order to start up process" +#Either keystore password or server certs location must be passed. Both cannot be null +if [ -z "${KEY_STORE_PASSWORD}" -a -z "${SERVER_CERTS_LOCATION}" ]; then + echo "KEY_STORE_PASSWORD or SERVER_CERTS_LOCATION must be set in order to start the process" exit 1 -else - echo "KEY_STORE_PASSWORD=$KEY_STORE_PASSWORD\n" >> $AJSC_CONF_HOME/etc/sysprops/sys-props.properties fi -if [ -z "$KEY_MANAGER_PASSWORD" ]; then - echo "KEY_MANAGER_PASSWORD must be set in order to start up process" - exit 1 -else - echo "KEY_MANAGER_PASSWORD=$KEY_MANAGER_PASSWORD\n" >> $AJSC_CONF_HOME/etc/sysprops/sys-props.properties +PROPS="-DAPP_HOME=${APP_HOME}" +PROPS="${PROPS} -DCONFIG_HOME=${CONFIG_HOME}" +PROPS="${PROPS} -Dtosca.mappings.config=${CONFIG_HOME}/tosca-mappings.json" + +if [ ! -z "$KEY_STORE_PASSWORD" ]; then + PROPS="${PROPS} -DKEY_STORE_PASSWORD=${KEY_STORE_PASSWORD}" +fi + +PROPS="${PROPS} -Dlogging.config=${APP_HOME}/config/logback.xml" + +if [ ! -z "$REQUIRE_CLIENT_AUTH" ]; then + PROPS="$PROPS -Dserver.ssl.client-auth=${REQUIRE_CLIENT_AUTH}" +fi +if [ ! -z "$SERVER_CERTS_LOCATION" ]; then + PROPS="$PROPS -Dserver.certs.location=${SERVER_CERTS_LOCATION}" + PROPS="$PROPS -Dserver.ssl.key-store=${SERVER_CERTS_LOCATION}/${SERVER_KEY_STORE}" + PROPS="$PROPS -Dserver.ssl.trust-store=${SERVER_CERTS_LOCATION}/${SERVER_TRUST_STORE}" fi -} - -CLASSPATH="$AJSC_HOME/lib/*" -CLASSPATH="$CLASSPATH:$AJSC_HOME/extJars/" -CLASSPATH="$CLASSPATH:$AJSC_HOME/etc/" -PROPS="-DAJSC_HOME=$AJSC_HOME" -PROPS="$PROPS -DAJSC_CONF_HOME=$BASEDIR/bundleconfig/" -PROPS="$PROPS -Dlogback.configurationFile=$BASEDIR/bundleconfig/etc/logback.xml" -PROPS="$PROPS -DAJSC_SHARED_CONFIG=$AJSC_CONF_HOME" -PROPS="$PROPS -DAJSC_SERVICE_NAMESPACE=babel" -PROPS="$PROPS -DAJSC_SERVICE_VERSION=v1" -PROPS="$PROPS -Dserver.port=9516" -PROPS="$PROPS -DCONFIG_HOME=$CONFIG_HOME" -PROPS="$PROPS -Dartifactgenerator.config=$CONFIG_HOME/artifact-generator.properties" -JVM_MAX_HEAP=${MAX_HEAP:-1024} - -echo $CLASSPATH - -exec java -Xmx${JVM_MAX_HEAP}m $PROPS -classpath $CLASSPATH com.att.ajsc.runner.Runner context=// sslport=9516 +PROPS="${PROPS} -Dspring.profiles.active=${SPRING_PROFILES_ACTIVE}" +PROPS="${PROPS} -Daaf.cadi.file=${CONFIG_HOME}/cadi.properties" + +exec java ${JVM_OPTS} ${PROPS} -jar ${APP_HOME}/babel*.jar +