blob: 681a9e789fd6c0afc6ea981ec171f5d06a51f195 [file] [log] [blame]
Guangrong Fu603b27e2017-09-04 18:26:10 +08001#!/bin/bash
2#
3# Copyright 2017 ZTE Corporation.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17# Place the scripts in run order:
18
19# Download and start MySQL
Guangrong Fu3d2e2ca2017-09-11 17:01:45 +080020docker pull postgres:9.5
Guangrong Fua9bba2f2017-09-05 18:54:14 +080021docker run --name postgres-holmes -p 5432:5432 -e POSTGRES_USER=holmes -e POSTGRES_PASSWORD=holmespwd -d postgres:9.5
22DB_IP=`get-instance-ip.sh postgres-holmes`
23echo DB_IP=${DB_IP}
Guangrong Fu603b27e2017-09-04 18:26:10 +080024
25#login to the onap nexus docker repo
26docker login -u docker -p docker nexus3.onap.org:10001
27
28# Start MSB
Guangrong Fu3d2e2ca2017-09-11 17:01:45 +080029docker run -d -p 8500:8500 --name msb_consul consul
Guangrong Fu603b27e2017-09-04 18:26:10 +080030CONSUL_IP=`get-instance-ip.sh msb_consul`
31echo CONSUL_IP=${CONSUL_IP}
32docker run -d -p 10081:10081 -e CONSUL_IP=$CONSUL_IP --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery
33DISCOVERY_IP=`get-instance-ip.sh msb_discovery`
34echo DISCOVERY_IP=${DISCOVERY_IP}
35docker run -d -p 80:80 -e CONSUL_IP=$CONSUL_IP -e SDCLIENT_IP=$DISCOVERY_IP --name msb_internal_apigateway nexus3.onap.org:10001/onap/msb/msb_apigateway
Guangrong Fua9bba2f2017-09-05 18:54:14 +080036MSB_IP=`get-instance-ip.sh msb_internal_apigateway`
Guangrong Fu603b27e2017-09-04 18:26:10 +080037echo MSB_IP=${MSB_IP}
38
39# Start rulemgt
Guangrong Fu16ca4372017-09-16 16:27:14 +080040source ${SCRIPTS}/holmes/rule-management/startup.sh i-rulemgt ${DB_IP} ${MSB_IP} 1
Guangrong Fu603b27e2017-09-04 18:26:10 +080041RULEMGT_IP=`get-instance-ip.sh i-rulemgt`
42echo RULEMGT_IP=${RULEMGT_IP}
43
44# Wait for initialization
45for i in {1..20}; do
46 curl -sS -m 1 ${RULEMGT_IP}:9101 && curl -sS -m 1 ${MSB_IP}:80 && break
47 echo sleep $i
48 sleep $i
49done
50
51# Start engine-d
Guangrong Fu16ca4372017-09-16 16:27:14 +080052source ${SCRIPTS}/holmes/engine-management/startup.sh i-engine-d ${DB_IP} ${MSB_IP} 1
Guangrong Fu603b27e2017-09-04 18:26:10 +080053ENGINE_D_IP=`get-instance-ip.sh i-engine-d`
54echo ENGINE_D_IP=${ENGINE_D_IP}
55
56
57# Wait for initialization
58for i in {1..10}; do
59 curl -sS -m 1 ${ENGINE_D_IP}:9102 && break
60 echo sleep $i
61 sleep $i
62done
63
64#Pass any variables required by Robot test suites in ROBOT_VARIABLES
65ROBOT_VARIABLES="-v MSB_IP:${MSB_IP} -v RULEMGT_IP:${RULEMGT_IP} -v ENGINE_D_IP:${ENGINE_D_IP}"
66