X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=engine-d-standalone%2Fsrc%2Fmain%2Fassembly%2Fbin%2Frun.sh;h=3f3c66271fc41766db09219af03c7a8bc41a4057;hb=1177d23e2be4a99f231b2d886ea121bf4e0611bc;hp=48795d1f8e769610c06b288cd7242abb4e1991de;hpb=d7692a268bb54f45f21cd8227a07df67d9277bde;p=holmes%2Fengine-management.git diff --git a/engine-d-standalone/src/main/assembly/bin/run.sh b/engine-d-standalone/src/main/assembly/bin/run.sh index 48795d1..3f3c662 100644 --- a/engine-d-standalone/src/main/assembly/bin/run.sh +++ b/engine-d-standalone/src/main/assembly/bin/run.sh @@ -1,3 +1,5 @@ +#!/bin/bash + # # Copyright 2017 ZTE Corporation. # @@ -28,26 +30,53 @@ port=8312 #JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=$port,server=y,suspend=n" echo @JAVA_OPTS@ $JAVA_OPTS -class_path="$main_path/:$main_path/holmes-engine-d.jar" +class_path="$main_path/*:$main_path/lib/*:$main_path/holmes-engine-d.jar" echo @class_path@ $class_path sed -i "s/activemq.username=.*/activemq.username=activemq/" /home/activemq/apache-activemq-5.9.0/conf/credentials.properties sed -i "s/activemq.password=.*/activemq.password=v1/" /home/activemq/apache-activemq-5.9.0/conf/credentials.properties /home/activemq/apache-activemq-5.9.0/bin/activemq start -sed -i "s|url:.*|url: jdbc:postgresql://$URL_JDBC/holmes|" "$main_path/conf/engine-d.yml" +if [ -z ${JDBC_USERNAME} ]; then + export JDBC_USERNAME=holmes + echo "No user name is specified for the database. Use the default value \"$JDBC_USERNAME\"." +fi + +if [ -z ${JDBC_PASSWORD} ]; then + export JDBC_PASSWORD=holmespwd + echo "No password is specified for the database. Use the default value \"$JDBC_PASSWORD\"." +fi + +if [ -z ${DB_NAME} ]; then + export DB_NAME=holmes + echo "No database is name is specified. Use the default value \"$DB_NAME\"." +fi +sed -i "s|url:.*|url: jdbc:postgresql://$URL_JDBC/$DB_NAME|" "$main_path/conf/engine-d.yml" +sed -i "s|user:.*|user: $JDBC_USERNAME|" "$main_path/conf/engine-d.yml" +sed -i "s|password:.*|password: $JDBC_PASSWORD|" "$main_path/conf/engine-d.yml" export SERVICE_IP=`hostname -i` echo SERVICE_IP=${SERVICE_IP} -if [ ${TESTING} == 1 ] - export HOSTNAME=${SERVICE_IP}:9102 +if [ ! -z ${TESTING} ] && [ ${TESTING} == 1 ]; then + if [ ! -z ${HOST_IP} ]; then + export HOSTNAME=${HOST_IP}:9102 + else + export HOSTNAME=${SERVICE_IP}:9102 + fi fi #ActiveMQ IP Configurations sed -i "s|brokerIp:.*|brokerIp: $SERVICE_IP|" "$main_path/conf/engine-d.yml" +KEY_PATH="$main_path/conf/holmes.keystore" +KEY_PASSWORD="holmes" + +#HTTPS Configurations +sed -i "s|keyStorePath:.*|keyStorePath: $KEY_PATH|" "$main_path/conf/engine-d.yml" +sed -i "s|keyStorePassword:.*|keyStorePassword: $KEY_PASSWORD|" "$main_path/conf/engine-d.yml" + cat "$main_path/conf/engine-d.yml"