summaryrefslogtreecommitdiffstats
path: root/boot/msb_vm_init.sh
diff options
context:
space:
mode:
authorHuabingZhao <zhao.huabing@zte.com.cn>2017-09-20 13:07:31 +0800
committerHuabingZhao <zhao.huabing@zte.com.cn>2017-09-20 14:03:55 +0800
commitb9742163a50d1971567f924315708106c7235075 (patch)
tree02339a188f13ba65a8d8b63ee105b9b75cb2e861 /boot/msb_vm_init.sh
parent5ca1266fbdf0d3131868b28840082db8352b77e7 (diff)
Add VM init script for MSB
Change-Id: I4ac9b1ddb6f30563f585e45b4856de8bd7c35873 Issue-Id: MSB-77 Signed-off-by: HuabingZhao <zhao.huabing@zte.com.cn>
Diffstat (limited to 'boot/msb_vm_init.sh')
-rw-r--r--boot/msb_vm_init.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/boot/msb_vm_init.sh b/boot/msb_vm_init.sh
new file mode 100644
index 00000000..61f7cba4
--- /dev/null
+++ b/boot/msb_vm_init.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+NEXUS_USERNAME=onap
+NEXUS_PASSWD=onap
+NEXUS_DOCKER_REPO=nexus3.onap.org:10001
+# DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt)
+DOCKER_IMAGE_VERSION=latest
+
+
+docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO
+docker pull $NEXUS_DOCKER_REPO/onap/msb/msb_discovery:$DOCKER_IMAGE_VERSION
+docker pull $NEXUS_DOCKER_REPO/onap/msb/msb_apigateway:$DOCKER_IMAGE_VERSION
+
+docker rm -f msb_consul
+docker rm -f msb_discovery
+docker rm -f msb_apigateway
+
+docker run -d -p 8500:8500 --name msb_consul consul
+CONSUL_IP=`sudo docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' msb_consul`
+
+docker run -d -p 10081:10081 -e CONSUL_IP=$CONSUL_IP --name msb_discovery $NEXUS_DOCKER_REPO/onap/msb/msb_discovery:$DOCKER_IMAGE_VERSION
+DISCOVERY_IP=`sudo docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' msb_discovery`
+
+docker run -d -p 80:80 -e CONSUL_IP=$CONSUL_IP -e SDCLIENT_IP=$DISCOVERY_IP -e "ROUTE_LABELS=visualRange:0|1" --name msb_apigateway $NEXUS_DOCKER_REPO/onap/msb/msb_apigateway:$DOCKER_IMAGE_VERSION \ No newline at end of file