6 # script to launch DMaaP DR docker containers
7 # sets global var IP with assigned IP address of DR Prov
9 function dmaap_dr_launch() {
13 # This next section was copied from scripts/dmaap-datarouter/dr-suite/setup.sh
14 # and slightly modified...
16 # Clone DMaaP Data Router repo
17 mkdir -p $WORKSPACE/archives/dmaapdr
18 cd $WORKSPACE/archives/dmaapdr
20 git clone --depth 1 https://gerrit.onap.org/r/dmaap/datarouter -b master
23 cd $WORKSPACE/archives/dmaapdr/datarouter/docker-compose/
25 sed -i 's/10003/10001/g' docker-compose.yml
26 # start DMaaP DR containers with docker compose and configuration from docker-compose.yml
27 docker login -u docker -p docker nexus3.onap.org:10001
30 # Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb
32 if [ $(docker inspect --format '{{ .State.Running }}' datarouter-node) ] && \
33 [ $(docker inspect --format '{{ .State.Running }}' datarouter-prov) ] && \
34 [ $(docker inspect --format '{{ .State.Running }}' mariadb) ]
36 echo "DR Service Running"
44 DR_PROV_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-prov)
45 DR_NODE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-node)
46 DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' datarouter-prov)
48 echo DR_PROV_IP=${DR_PROV_IP}
49 echo DR_NODE_IP=${DR_NODE_IP}
50 echo DR_GATEWAY_IP=${DR_GATEWAY_IP}
52 docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$DR_GATEWAY_IP"
53 docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$DR_GATEWAY_IP"
55 #Pass any variables required by Robot test suites in ROBOT_VARIABLES
56 ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DR_NODE_IP:${DR_NODE_IP}"