dglFromAtt | 62b8b12 | 2018-03-03 11:57:29 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # script to launch DMaaP buscontroller docker container |
| 4 | # sets global var IP with assigned IP address |
| 5 | |
| 6 | function dmaapbc_launch() { |
Dominic Lunanuova | db5f989 | 2018-04-20 18:54:47 +0000 | [diff] [blame] | 7 | TAG="nexus3.onap.org:10001/onap/dmaap/buscontroller" |
dglFromAtt | 62b8b12 | 2018-03-03 11:57:29 -0500 | [diff] [blame] | 8 | CONTAINER_NAME=dmaapbc |
| 9 | IP="" |
| 10 | |
| 11 | cd ${WORKSPACE}/test/csit/scripts/dmaap-buscontroller |
| 12 | |
Dominic Lunanuova | db5f989 | 2018-04-20 18:54:47 +0000 | [diff] [blame] | 13 | TMP_CFG=/tmp/docker-databus-controller.conf |
dglFromAtt | 62b8b12 | 2018-03-03 11:57:29 -0500 | [diff] [blame] | 14 | . ./onapCSIT.env > $TMP_CFG |
Dominic Lunanuova | f118f2e | 2018-09-04 23:14:13 +0000 | [diff] [blame] | 15 | ADDHOSTS="" |
| 16 | if [ ! -z "$2" ] |
| 17 | then |
| 18 | ADDHOSTS="$ADDHOSTS --add-host=message-router:$2" |
| 19 | fi |
| 20 | if [ ! -z "$3" ] |
| 21 | then |
| 22 | ADDHOSTS="$ADDHOSTS --add-host=dmaap-dr-prov:$3" |
| 23 | fi |
| 24 | docker run -d $ADDHOSTS --name $CONTAINER_NAME -v $TMP_CFG:/opt/app/config/conf $TAG |
dglFromAtt | 62b8b12 | 2018-03-03 11:57:29 -0500 | [diff] [blame] | 25 | IP=`get-instance-ip.sh ${CONTAINER_NAME}` |
| 26 | |
| 27 | # Wait for initialization |
| 28 | for i in {1..10}; do |
| 29 | curl -sS ${IP}:8080 && break |
| 30 | echo sleep $i |
| 31 | sleep $i |
| 32 | done |
| 33 | |
dglFromAtt | 62b8b12 | 2018-03-03 11:57:29 -0500 | [diff] [blame] | 34 | } |