summaryrefslogtreecommitdiffstats
path: root/rulemgt-standalone/src/main/assembly/bin/run.sh
diff options
context:
space:
mode:
authorGuangrongFu <fu.guangrong@zte.com.cn>2021-03-09 18:28:13 +0800
committerGuangrongFu <fu.guangrong@zte.com.cn>2021-03-09 18:28:13 +0800
commitbf43529b242519e3c8c690820bba8dd4e8831d8a (patch)
treeaadc999239bcd9dfc4c2c0ba22e8d02c00008fc0 /rulemgt-standalone/src/main/assembly/bin/run.sh
parent74ade28e3e5d8bfa2d4d82ae394c98de034b8ec6 (diff)
Init DB Using envsubst
Change-Id: I764626136258f3fb23561ee90a46653ebdbe9413 Issue-ID: HOLMES-396 Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn>
Diffstat (limited to 'rulemgt-standalone/src/main/assembly/bin/run.sh')
-rw-r--r--rulemgt-standalone/src/main/assembly/bin/run.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/rulemgt-standalone/src/main/assembly/bin/run.sh b/rulemgt-standalone/src/main/assembly/bin/run.sh
index bb5884b..3e0ff97 100644
--- a/rulemgt-standalone/src/main/assembly/bin/run.sh
+++ b/rulemgt-standalone/src/main/assembly/bin/run.sh
@@ -48,10 +48,14 @@ if [ -z ${DB_NAME} ]; then
echo "No database is name is specified. Use the default value \"$DB_NAME\"."
fi
-sed -i "s|user:.*|user: $JDBC_USERNAME|" "$main_path/conf/rulemgt.yml"
-sed -i "s|password:.*|password: $JDBC_PASSWORD|" "$main_path/conf/rulemgt.yml"
-sed -i "s|url:.*|url: jdbc:postgresql://$URL_JDBC/$DB_NAME|" "$main_path/conf/rulemgt.yml"
-sed -i "s|msbServerAddr:.*|msbServerAddr: http://$MSB_ADDR|" "$main_path/conf/rulemgt.yml"
+# if deployed using helm, use the helm-generated configuration file.
+if [[ -d /opt/hrmconfig ]]; then
+ cp /opt/hrmconfig/rulemgt.yml "$main_path/conf/rulemgt.yml"
+else
+ sed -i "s|user:.*|user: $JDBC_USERNAME|" "$main_path/conf/rulemgt.yml"
+ sed -i "s|password:.*|password: $JDBC_PASSWORD|" "$main_path/conf/rulemgt.yml"
+ sed -i "s|url:.*|url: jdbc:postgresql://$URL_JDBC/$DB_NAME|" "$main_path/conf/rulemgt.yml"
+fi
export SERVICE_IP=`hostname -i`
echo SERVICE_IP=${SERVICE_IP}
@@ -96,7 +100,7 @@ else
fi
-${RUNHOME}/initDB.sh $JDBC_USERNAME $JDBC_PASSWORD $DB_NAME $DB_PORT "${URL_JDBC%:*}"
+${RUNHOME}/initDB.sh "$JDBC_USERNAME" "$JDBC_PASSWORD" "$DB_NAME" "$DB_PORT" "${URL_JDBC%:*}"
#Register the fronten to MSB