aboutsummaryrefslogtreecommitdiffstats
path: root/docker/instance_config.sh
diff options
context:
space:
mode:
authordyh <dengyuanhong@chinamobile.com>2019-04-19 13:57:46 +0800
committerdyh <dengyuanhong@chinamobile.com>2019-04-19 14:01:10 +0800
commitaffcd0828f0dd0941ba546aca5bce05e8ee1a598 (patch)
treea20b80dbc987dde4ee3e65f3b29e81b49c93cb4f /docker/instance_config.sh
parent4735409872776f9675df733087dcb1b61b038ab0 (diff)
genericparser seed code
Change-Id: Id15ac689c1d560619bf6c699fb0786e7381d3def Issue-ID: MODELING-153 Signed-off-by: dyh <dengyuanhong@chinamobile.com>
Diffstat (limited to 'docker/instance_config.sh')
-rw-r--r--docker/instance_config.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/docker/instance_config.sh b/docker/instance_config.sh
new file mode 100644
index 0000000..a03c41a
--- /dev/null
+++ b/docker/instance_config.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+MSB_IP=`echo $MSB_ADDR | cut -d: -f 1`
+MSB_PORT=`echo $MSB_ADDR | cut -d: -f 2`
+# modeling/genericparser
+
+if [ $MSB_IP ]; then
+# sed -i "s|MSB_SERVICE_IP.*|MSB_SERVICE_IP = '$MSB_IP'|" vfc/nfvo/genericparser/genericparser/pub/config/config.py
+ sed -i "s|MSB_SERVICE_IP.*|MSB_SERVICE_IP = '$MSB_IP'|" modeling/genericparser/genericparser/pub/config/config.py
+fi
+
+if [ $MSB_PORT ]; then
+# sed -i "s|MSB_SERVICE_PORT.*|MSB_SERVICE_PORT = '$MSB_PORT'|" vfc/nfvo/genericparser/genericparser/pub/config/config.py
+ sed -i "s|MSB_SERVICE_PORT.*|MSB_SERVICE_PORT = '$MSB_PORT'|" modeling/genericparser/genericparser/pub/config/config.py
+fi
+
+if [ $SERVICE_IP ]; then
+# sed -i "s|\"ip\": \".*\"|\"ip\": \"$SERVICE_IP\"|" vfc/nfvo/genericparser/genericparser/pub/config/config.py
+ sed -i "s|\"ip\": \".*\"|\"ip\": \"$SERVICE_IP\"|" modeling/genericparser/genericparser/pub/config/config.py
+fi
+
+MYSQL_IP=`echo $MYSQL_ADDR | cut -d: -f 1`
+MYSQL_PORT=`echo $MYSQL_ADDR | cut -d: -f 2`
+echo "MYSQL_ADDR=$MYSQL_ADDR"
+
+if [ $REDIS_ADDR ]; then
+ REDIS_IP=`echo $REDIS_ADDR | cut -d: -f 1`
+else
+ REDIS_IP="$MYSQL_ADDR"
+fi
+
+#sed -i "s|DB_IP.*|DB_IP = '$MYSQL_IP'|" vfc/nfvo/genericparser/genericparser/pub/config/config.py
+#sed -i "s|DB_PORT.*|DB_PORT = $MYSQL_PORT|" vfc/nfvo/genericparser/genericparser/pub/config/config.py
+#sed -i "s|REDIS_HOST.*|REDIS_HOST = '$REDIS_IP'|" vfc/nfvo/genericparser/genericparser/pub/config/config.py
+#
+#cat vfc/nfvo/genericparser/genericparser/pub/config/config.py
+
+sed -i "s|DB_IP.*|DB_IP = '$MYSQL_IP'|" modeling/genericparser/genericparser/pub/config/config.py
+sed -i "s|DB_PORT.*|DB_PORT = $MYSQL_PORT|" modeling/genericparser/genericparser/pub/config/config.py
+sed -i "s|REDIS_HOST.*|REDIS_HOST = '$REDIS_IP'|"modeling/genericparser/genericparser/pub/config/config.py
+
+cat modeling/genericparser/genericparser/pub/config/config.py