blob: 89688eeaffe5619875b639c594cf04241dd91400 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001#!/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
20docker pull postgres:9.5
21docker 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}
24
25#login to the onap nexus docker repo
26docker login -u docker -p docker nexus3.onap.org:10001
27
28# Start MSB
29docker run -d -p 8500:8500 --name msb_consul consul:0.9.3
30CONSUL_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
36MSB_IP=`get-instance-ip.sh msb_internal_apigateway`
37echo MSB_IP=${MSB_IP}
38
39# Start rulemgt
40source ${SCRIPTS}/holmes/rule-management/startup.sh i-rulemgt ${DB_IP} ${MSB_IP} 1
41RULEMGT_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
52source ${SCRIPTS}/holmes/engine-management/startup.sh i-engine-d ${DB_IP} ${MSB_IP} 1
53ENGINE_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
64echo sleep 30s for service registration
65sleep 30
66
67docker logs i-rulemgt
68docker logs i-engine-d
69
70#Pass any variables required by Robot test suites in ROBOT_VARIABLES
71ROBOT_VARIABLES="-v MSB_IP:${MSB_IP} -v RULEMGT_IP:${RULEMGT_IP} -v ENGINE_D_IP:${ENGINE_D_IP}"
72