Guangrong Fu | 603b27e | 2017-09-04 18:26:10 +0800 | [diff] [blame] | 1 | #!/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 Fu | 3d2e2ca | 2017-09-11 17:01:45 +0800 | [diff] [blame] | 20 | docker pull postgres:9.5 |
Guangrong Fu | a9bba2f | 2017-09-05 18:54:14 +0800 | [diff] [blame] | 21 | docker run --name postgres-holmes -p 5432:5432 -e POSTGRES_USER=holmes -e POSTGRES_PASSWORD=holmespwd -d postgres:9.5 |
| 22 | DB_IP=`get-instance-ip.sh postgres-holmes` |
| 23 | echo DB_IP=${DB_IP} |
Guangrong Fu | 603b27e | 2017-09-04 18:26:10 +0800 | [diff] [blame] | 24 | |
| 25 | #login to the onap nexus docker repo |
| 26 | docker login -u docker -p docker nexus3.onap.org:10001 |
| 27 | |
| 28 | # Start MSB |
Guangrong Fu | 3d2e2ca | 2017-09-11 17:01:45 +0800 | [diff] [blame] | 29 | docker run -d -p 8500:8500 --name msb_consul consul |
Guangrong Fu | 603b27e | 2017-09-04 18:26:10 +0800 | [diff] [blame] | 30 | CONSUL_IP=`get-instance-ip.sh msb_consul` |
| 31 | echo CONSUL_IP=${CONSUL_IP} |
| 32 | docker run -d -p 10081:10081 -e CONSUL_IP=$CONSUL_IP --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery |
| 33 | DISCOVERY_IP=`get-instance-ip.sh msb_discovery` |
| 34 | echo DISCOVERY_IP=${DISCOVERY_IP} |
| 35 | docker 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 Fu | a9bba2f | 2017-09-05 18:54:14 +0800 | [diff] [blame] | 36 | MSB_IP=`get-instance-ip.sh msb_internal_apigateway` |
Guangrong Fu | 603b27e | 2017-09-04 18:26:10 +0800 | [diff] [blame] | 37 | echo MSB_IP=${MSB_IP} |
| 38 | |
| 39 | # Start rulemgt |
Guangrong Fu | 16ca437 | 2017-09-16 16:27:14 +0800 | [diff] [blame] | 40 | source ${SCRIPTS}/holmes/rule-management/startup.sh i-rulemgt ${DB_IP} ${MSB_IP} 1 |
Guangrong Fu | 603b27e | 2017-09-04 18:26:10 +0800 | [diff] [blame] | 41 | RULEMGT_IP=`get-instance-ip.sh i-rulemgt` |
| 42 | echo RULEMGT_IP=${RULEMGT_IP} |
| 43 | |
| 44 | # Wait for initialization |
| 45 | for 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 |
| 49 | done |
| 50 | |
| 51 | # Start engine-d |
Guangrong Fu | 16ca437 | 2017-09-16 16:27:14 +0800 | [diff] [blame] | 52 | source ${SCRIPTS}/holmes/engine-management/startup.sh i-engine-d ${DB_IP} ${MSB_IP} 1 |
Guangrong Fu | 603b27e | 2017-09-04 18:26:10 +0800 | [diff] [blame] | 53 | ENGINE_D_IP=`get-instance-ip.sh i-engine-d` |
| 54 | echo ENGINE_D_IP=${ENGINE_D_IP} |
| 55 | |
| 56 | |
| 57 | # Wait for initialization |
| 58 | for i in {1..10}; do |
| 59 | curl -sS -m 1 ${ENGINE_D_IP}:9102 && break |
| 60 | echo sleep $i |
| 61 | sleep $i |
| 62 | done |
| 63 | |
| 64 | #Pass any variables required by Robot test suites in ROBOT_VARIABLES |
| 65 | ROBOT_VARIABLES="-v MSB_IP:${MSB_IP} -v RULEMGT_IP:${RULEMGT_IP} -v ENGINE_D_IP:${ENGINE_D_IP}" |
| 66 | |