summaryrefslogtreecommitdiffstats
path: root/mgr/docker/instance_config.sh
diff options
context:
space:
mode:
authorShashank Kumar Shankar <shashank.kumar.shankar@intel.com>2017-09-05 15:52:48 -0700
committerShashank Kumar Shankar <shashank.kumar.shankar@intel.com>2017-09-06 15:43:58 -0700
commitd816d444383c73862535c89483c01e0d125a722c (patch)
tree29217fce57467df58742a792b5d66cb17629fbb6 /mgr/docker/instance_config.sh
parentdff6a11d425677eec5909d2cdab9cc1c277719c7 (diff)
Add GVNFM VNFMGR Docker image and build scripts
This patch adds the scripts and Dockerfile for building GVNFM/VNFGR docker image. Change-Id: I4642228523691095ff77cd5fa0007d853e93b7d5 Issue-Id: VFC-282 Signed-off-by: Shashank Kumar Shankar <shashank.kumar.shankar@intel.com>
Diffstat (limited to 'mgr/docker/instance_config.sh')
-rwxr-xr-xmgr/docker/instance_config.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/mgr/docker/instance_config.sh b/mgr/docker/instance_config.sh
new file mode 100755
index 0000000..4848b91
--- /dev/null
+++ b/mgr/docker/instance_config.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+MSB_IP=`echo $MSB_ADDR | cut -d: -f 1`
+MSB_PORT=`echo $MSB_ADDR | cut -d: -f 2`
+
+if [ $MSB_IP ]; then
+ sed -i "s|MSB_SERVICE_IP.*|MSB_SERVICE_IP = '$MSB_IP'|" vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py
+fi
+
+if [ $MSB_PORT ]; then
+ sed -i "s|MSB_SERVICE_PORT.*|MSB_SERVICE_PORT = '$MSB_PORT'|" vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py
+fi
+
+if [ $SERVICE_IP ]; then
+ sed -i "s|\"ip\": \".*\"|\"ip\": \"$SERVICE_IP\"|" vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py
+ sed -i "s|127\.0\.0\.1|$SERVICE_IP|" vfc/gvnfm/vnfmgr/mgr/run.sh
+ sed -i "s|127\.0\.0\.1|$SERVICE_IP|" vfc/gvnfm/vnfmgr/mgr/stop.sh
+fi
+
+if [ $REDIS_HOST ]; then
+ sed -i "s|REDIS_HOST.*|REDIS_HOST = '$REDIS_HOST'|" vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py
+fi
+
+sed -i "s|DB_NAME.*|DB_NAME = 'gvnfm'|" vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py
+sed -i "s|DB_USER.*|DB_USER = 'gvnfm'|" vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py
+sed -i "s|DB_PASSWD.*|DB_PASSWD = 'gvnfm'|" vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py
+
+# Configure MYSQL
+if [ -z "$MYSQL_ADDR" ]; then
+ export MYSQL_IP=`hostname -i`
+ export MYSQL_PORT=3306
+ export MYSQL_ADDR=$MYSQL_IP:$MYSQL_PORT
+else
+ MYSQL_IP=`echo $MYSQL_ADDR | cut -d: -f 1`
+ MYSQL_PORT=`echo $MYSQL_ADDR | cut -d: -f 2`
+fi
+echo "MYSQL_ADDR=$MYSQL_ADDR"
+sed -i "s|DB_IP.*|DB_IP = '$MYSQL_IP'|" vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py
+sed -i "s|DB_PORT.*|DB_PORT = $MYSQL_PORT|" vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py
+
+cat vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py \ No newline at end of file