Enable specifying the Host IP using Script
[holmes/engine-management.git] / engine-d-standalone / src / main / assembly / bin / run.sh
index b33862d..59a1c18 100644 (file)
@@ -1,3 +1,5 @@
+#!/bin/bash
+
 #
 # Copyright 2017 ZTE Corporation.
 #
@@ -35,13 +37,21 @@ sed -i "s/activemq.username=.*/activemq.username=activemq/" /home/activemq/apach
 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:mysql://$URL_JDBC/holmes|" "$main_path/conf/engine-d.yml"
+sed -i "s|url:.*|url: jdbc:postgresql://$URL_JDBC/holmes|" "$main_path/conf/engine-d.yml"
 
 
 export SERVICE_IP=`hostname -i`
 echo SERVICE_IP=${SERVICE_IP}
 
-#ActiveMQ IP Configurtion
+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"
 
 cat "$main_path/conf/engine-d.yml"