X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=boot%2Fsdnc_vm_init.sh;h=a52368497f0a186ff612fef41f4a23a4303c328c;hb=16b51aa5e929b680957725fab2cb18d87a99fb1d;hp=c681e1a5993cdbdc58384de4879d6d2cbb4b682a;hpb=13acacacf107b027be129f4ad4a28923443816d9;p=demo.git diff --git a/boot/sdnc_vm_init.sh b/boot/sdnc_vm_init.sh index c681e1a5..a5236849 100644 --- a/boot/sdnc_vm_init.sh +++ b/boot/sdnc_vm_init.sh @@ -32,4 +32,21 @@ docker tag $NEXUS_DOCKER_REPO/onap/sdnc-ueb-listener-image:$DOCKER_IMAGE_VERSION docker pull $NEXUS_DOCKER_REPO/onap/sdnc-dmaap-listener-image:$DOCKER_IMAGE_VERSION docker tag $NEXUS_DOCKER_REPO/onap/sdnc-dmaap-listener-image:$DOCKER_IMAGE_VERSION onap/sdnc-dmaap-listener-image:latest -/opt/docker/docker-compose up -d +echo "Waiting for 10 minutes for SDC to start"; +RES=$(curl -s -X GET http://10.0.3.1:8080/sdc2/rest/healthCheck -H 'Accept: application/json' -H 'Cache-Control: no-cache' -H 'Content-Type: application/json' -H 'Postman-Token: ffeba4a6-82b6-44d8-87e6-8b510f1127fd' | jq '.componentsInfo[] | select(.healthCheckComponent == "BE") | .description') +counter=0; +while [[ $RES != "\"OK\"" ]]; do + sleep 10; + let counter=$counter+1 + if [[ $counter -eq 60 ]]; then + break; + fi +done + +if [[ $RES == "\"OK\"" ]]; then + echo "Starting SDNC containers" +else + echo "Timeout expired before SDC BE health check passed. SDNC containers starting, but UEB Listener may not be healthy" +fi + +/opt/docker/docker-compose up -d \ No newline at end of file