2 #############################################################################
4 # Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 #############################################################################
20 # prepare a curl command
21 # parameters: URL METHOD CURLOPTIONS EXTRA_HEADERS_AS_A_STRING AUTH_AS_USER:PASS DATA
22 assemble_curl_command()
26 local CURLOPTIONS="$3"
27 local EXTRA_HEADERS="$4"
31 if [ ! -z "$METHOD" ]; then
32 CMD="curl $CURLOPTIONS $METHOD"
34 CMD="curl $CURLOPTIONS -X GET"
36 if [ ! -z "$EXTRA_HEADERS" ]; then
37 CMD="$CMD $EXTRA_HEADERS"
39 if [ ! -z "$AUTH" ]; then
42 if [ ! -z "$DATA" ]; then
50 # Make a rest API call
51 # parameters: URL METHOD expected_response_code EXTRA_HEADERS_AS_A_STRING AUTH_AS_USER:PASS DATA
52 call_api_for_response_code()
54 local CURLOPTIONS='-kIso /dev/null -w "%{http_code}"'
56 $(assemble_curl_command "$1" "$2" "$CURLOPTIONS" "$4" "$5" "$6")
60 call_api_for_response_body()
62 local CURLOPTIONS='-ksb'
64 $(assemble_curl_command "$1" "$2" "$CURLOPTIONS" "$4" "$5" "$6")
68 call_api_for_response_header()
70 local CURLOPTIONS='-ks -o /dev/null -D -'
72 $(assemble_curl_command "$1" "$2" "$CURLOPTIONS" "$4" "$5" "$6")
76 call_api_for_verbose()
78 local CURLOPTIONS='-kIv'
80 $(assemble_curl_command "$1" "$2" "$CURLOPTIONS" "$4" "$5" "$6")
83 #local TFILE=$(mktemp /tmp/curlcmd.XXXXXXXXX)
90 # Wait till a web service API return specified response code
91 # parameters: URL METHOD EXPECTED_RESP_CODE EXTRA_HEADERS_AS_A_STRING AUTH_AS_USER:PASS DATA
96 ACTUALRESP=$(call_api_for_response_code "$1" "$2" "$3" "$4" "$5" "$6")
97 while [ "$ACTUALRESP" != "$RESP" ]; do
98 echo "RESP CODE $ACTUALRESP, not as expected RESP CODE $RESP @ $(date)."
100 ACTUALRESP=$(call_api_for_response_code "$1" "$2" "$3" "$4" "$5" "$6")
102 echo "RESP CODE $ACTUALRESP, matches with expected RESP CODE $RESP."
105 # Wait till a TCP port is open
106 # parameters: HOST PORT
111 while ! nc -z -w 1 "$DEST" "$PORT"; do
122 # wait till A&AI up and ready
124 AAIHOST=$(cat /opt/config/aai1_ip_addr.txt)
125 local AAIURL="https://$AAIHOST:8443/aai/v11/examples/cloud-regions"
126 local AAIMETHOD='-X GET'
128 local AAIHEADERS='-H "X-FromAppId: AAI-Temp-Tool" -H "X-TransactionId: AAI-Temp-Tool" -H "Real-Time: true" -H "Content-Type: application/json" -H "Accept: application/json"'
129 local AAIAUTH='-u AAI:AAI'
131 echo "===> Waiting for A&AI to get ready for getting $AAIRESP from $AAIURL @ $(date)"
132 wait_for_api "$AAIURL" "$AAIMETHOD" "$AAIRESP" "$AAIHEADERS" "$AAIAUTH" "$AAIDATA"
133 echo "===> A&AI ready @ $(date)"
138 wait_for_multicloud_ready()
140 # wait till MultiCloud up and ready
142 MCHOST=$(cat /opt/config/openo_ip_addr.txt)
143 local MCURL="http://$MCHOST:9005/api/multicloud-titanium_cloud/v0/swagger.json"
144 local MCMETHOD='-X GET'
146 local MCHEADERS='-H "Real-Time: true" -H "Content-Type: application/json" -H "Accept: application/json"'
149 echo "===> Waiting for MultiCloud to get ready for getting $MCRESP from $MCURL @ $(date)"
150 wait_for_api "$MCURL" "$MCMETHOD" "$MCRESP" "$MCHEADERS" "$MCAUTH" "$MCDATA"
151 echo "===> MultiCloud ready @ $(date)"
154 register_multicloud_pod25dns_with_aai()
156 # Register MultiCloud with A&AI
157 local CLOUD_OWNER='pod25dns'
158 local CLOUD_VERSION='titanium_cloud'
161 local CLOUD_IDENTITY_URL
162 local DNSAAS_SERVICE_URL
163 local DNSAAS_USERNAME
164 local DNSAAS_PASSWORD
165 local DNSAAS_TENANT_ID
167 CLOUD_REGION="$(cat /opt/config/openstack_region.txt)"
168 CLOUD_ENV="$(cat /opt/config/cloud_env.txt)"
169 MCIP="$(cat /opt/config/openo_ip_addr.txt)"
170 CLOUD_IDENTITY_URL="http://${MCIP}/api/multicloud-titanium_cloud/v0/${CLOUD_OWNER}_${CLOUD_REGION}/identity/v2.0"
173 DNSAAS_SERVICE_URL="$(cat /opt/config/dnsaas_keystone_url.txt)"
174 DNSAAS_USERNAME="$(cat /opt/config/dnsaas_username.txt)"
175 DNSAAS_PASSWORD="$(cat /opt/config/dnsaas_password.txt)"
176 DNSAAS_TENANT_ID="$(cat /opt/config/dnsaas_tenant_id.txt)"
177 cat >"/tmp/${CLOUD_OWNER}_${CLOUD_REGION}.json" <<EOL
179 "cloud-owner" : "$CLOUD_OWNER",
180 "cloud-region-id" : "$CLOUD_REGION",
181 "cloud-region-version" : "$CLOUD_VERSION",
182 "cloud-type" : "$CLOUD_ENV",
183 "cloud-zone" : "cloud zone",
184 "complex-name" : "complex name2",
185 "identity-url": "$CLOUD_IDENTITY_URL",
186 "owner-defined-type" : "owner-defined-type",
187 "sriov-automation" : false,
188 "esr-system-info-list" : {
189 "esr-system-info" : [
191 "esr-system-info-id": "532ac032-e996-41f2-84ed-9c7a1766eb30",
192 "cloud-domain": "Default",
193 "default-tenant" : "$DNSAAS_TENANT_ID",
194 "user-name" : "$DNSAAS_USERNAME",
195 "password" : "$DNSAAS_PASSWORD",
196 "service-url" : "$DNSAAS_SERVICE_URL",
197 "ssl-cacert": "example-ssl-cacert-val-75021",
198 "ssl-insecure": true,
199 "system-name": "example-system-name-val-29071",
200 "system-type": "VIM",
201 "ip-address": "example-ip-address-val-44432",
202 "port": "example-port-val-93235",
203 "type": "example-type-val-85255",
204 "protocal": "example-protocal-val-52954",
205 "vendor": "example-vendor-val-94515",
206 "version": "example-version-val-71880"
216 local REGMETHOD='-X PUT'
217 local REGHEADERS='-H "X-FromAppId: AAI-Temp-Tool" -H "X-TransactionId: AAI-Temp-Tool" -H "Real-Time: true" -H "Content-Type: application/json" -H "Accept: application/json"'
219 local REGAUTH='-u AAI:AAI'
222 REGHOST="$(cat /opt/config/aai1_ip_addr.txt)"
223 REGURL="https://$REGHOST:8443/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/$CLOUD_OWNER/$CLOUD_REGION"
224 REGDATA="-T /tmp/${CLOUD_OWNER}_${CLOUD_REGION}.json"
225 echo "Register MultiCloud with A&AI owner $CLOUD_OWNER"
226 RESP=$(call_api_for_response_code "$REGURL" "$REGMETHOD" "$REGRESP" "$REGHEADERS" "$REGAUTH" "$REGDATA")
227 echo "RESP CODE: $RESP"
231 register_multicloud_pod25_with_aai()
233 # Register MultiCloud with A&AI
234 local CLOUD_OWNER='pod25'
235 local CLOUD_VERSION='titanium_cloud'
239 local CLOUD_IDENTITY_URL
245 CLOUD_REGION="$(cat /opt/config/openstack_region.txt)"
246 CLOUD_ENV="$(cat /opt/config/cloud_env.txt)"
247 MCIP="$(cat /opt/config/openo_ip_addr.txt)"
248 CLOUD_IDENTITY_URL="http://${MCIP}/api/multicloud-titanium_cloud/v0/${CLOUD_OWNER}_${CLOUD_REGION}/identity/v2.0"
249 KEYSTONE_URL="$(cat /opt/config/openstack_keystone_url.txt)"
250 USERNAME="$(cat /opt/config/openstack_user.txt)"
251 PASSWORD="$(cat /opt/config/openstack_password.txt)"
252 TENANT_ID="$(cat /opt/config/tenant_id.txt)"
253 cat >"/tmp/${CLOUD_OWNER}_${CLOUD_REGION}.json" <<EOL
255 "cloud-owner" : "$CLOUD_OWNER",
256 "cloud-region-id" : "$CLOUD_REGION",
257 "cloud-region-version" : "$CLOUD_VERSION",
258 "cloud-type" : "$CLOUD_ENV",
259 "cloud-zone" : "cloud zone",
260 "complex-name" : "complex name",
261 "identity-url": "$CLOUD_IDENTITY_URL",
262 "owner-defined-type" : "owner-defined-type",
263 "sriov-automation" : false,
264 "cloud-extra-info" : "{\"epa-caps\":{\"huge_page\":\"true\",\"cpu_pinning\":\"true\",\"cpu_thread_policy\":\"true\",\"numa_aware\":\"true\",\"sriov\":\"true\",\"dpdk_vswitch\":\"true\",\"rdt\":\"false\",\"numa_locality_pci\":\"true\"},\"dns-delegate\":{\"cloud-owner\":\"pod25dns\",\"cloud-region-id\":\"RegionOne\"}}",
265 "esr-system-info-list" : {
266 "esr-system-info" : [
268 "esr-system-info-id": "432ac032-e996-41f2-84ed-9c7a1766eb29",
269 "cloud-domain": "Default",
270 "default-tenant" : "$TENANT_ID",
271 "user-name" : "$USERNAME",
272 "password" : "$PASSWORD",
273 "service-url" : "$KEYSTONE_URL",
274 "ssl-cacert": "example-ssl-cacert-val-75021",
275 "ssl-insecure": true,
276 "system-name": "example-system-name-val-29070",
277 "system-type": "VIM",
278 "ip-address": "example-ip-address-val-44431",
279 "port": "example-port-val-93234",
280 "type": "example-type-val-85254",
281 "protocal": "example-protocal-val-52954",
282 "vendor": "example-vendor-val-94515",
283 "version": "example-version-val-71880"
292 local REGMETHOD='-X PUT'
293 local REGHEADERS='-H "X-FromAppId: AAI-Temp-Tool" -H "X-TransactionId: AAI-Temp-Tool" -H "Real-Time: true" -H "Content-Type: application/json" -H "Accept: application/json"'
295 local REGAUTH='-u AAI:AAI'
298 REGHOST="$(cat /opt/config/aai1_ip_addr.txt)"
299 REGURL="https://$REGHOST:8443/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/$CLOUD_OWNER/$CLOUD_REGION"
300 REGDATA="-T /tmp/${CLOUD_OWNER}_${CLOUD_REGION}.json"
301 echo "Register MultiCloud with A&AI owner $CLOUD_OWNER"
302 RESP=$(call_api_for_response_code "$REGURL" "$REGMETHOD" "$REGRESP" "$REGHEADERS" "$REGAUTH" "$REGDATA")
303 echo "RESP CODE: $RESP"
308 verify_multicloud_registration()
310 local CLOUD_OWNER='pod25'
312 local CLOUD_VERSION='titanium_cloud'
316 local REGMETHOD='-X GET'
317 local REGHEADERS='-H "X-FromAppId: AAI-Temp-Tool" -H "X-TransactionId: AAI-Temp-Tool" -H "Real-Time: true" -H "Content-Type: application/json" -H "Accept: application/json"'
319 local REGAUTH='-u AAI:AAI'
323 CLOUD_REGION="$(cat /opt/config/openstack_region.txt)"
324 CLOUD_ENV="$(cat /opt/config/cloud_env.txt)"
325 REGHOST="$(cat /opt/config/aai1_ip_addr.txt)"
327 REGURL="https://$REGHOST:8443/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/${CLOUD_OWNER}/${CLOUD_REGION}?depth=all"
328 # Verify MultiCloud with A&AI
329 RESPCODE=$(call_api_for_response_code "$REGURL" "$REGMETHOD" "$REGRESP" "$REGHEADERS" "$REGAUTH" "$REGDATA")
330 echo "Register MultiCloud with A&AI owner $CLOUD_OWNER verify response code: $RESPCODE"
332 CLOUD_OWNER='pod25dns'
333 REGURL="https://$REGHOST:8443/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/${CLOUD_OWNER}/${CLOUD_REGION}?depth=all"
334 RESPCODE=$(call_api_for_response_code "$REGURL" "$REGMETHOD" "$REGRESP" "$REGHEADERS" "$REGAUTH" "$REGDATA")
335 echo "Register MultiCloud with A&AI owner $CLOUD_OWNER verify response code: $RESPCODE"
341 local CLOUD_OWNER='pod25'
343 local CLOUD_VERSION='titanium_cloud'
346 local DNSAAS_TENANT_ID
349 local MCMETHOD='-X POST'
351 local MCHEADERS='-H "Content-Type: application/json" -H "Accept: application/json"'
355 ## export endpoint prefix
356 local MULTICLOUD_PLUGIN_ENDPOINT
358 CLOUD_REGION="$(cat /opt/config/openstack_region.txt)"
359 CLOUD_ENV="$(cat /opt/config/cloud_env.txt)"
360 if [ -z "$1" ]; then DCAE_ZONE="$(cat /opt/config/dcae_zone.txt)"; else DCAE_ZONE="$1"; fi
361 DNSAAS_TENANT_ID="$(cat /opt/config/dnsaas_tenant_id.txt)"
362 MCHOST=$(cat /opt/config/openo_ip_addr.txt)
363 MCURL="http://$MCHOST:9005/api/multicloud-titanium_cloud/v0/swagger.json"
365 MULTICLOUD_PLUGIN_ENDPOINT=http://${MCHOST}/api/multicloud-titanium_cloud/v0/${CLOUD_OWNER}_${CLOUD_REGION}
366 MULTICLOUD_PLUGIN_ENDPOINT=http://${MCHOST}:9005/api/multicloud-titanium_cloud/v0/${CLOUD_OWNER}_${CLOUD_REGION}
372 MCURL="${MULTICLOUD_PLUGIN_ENDPOINT}/identity/v3/auth/tokens"
373 TOKEN=$(call_api_for_response_header "$MCURL" "$MCMETHOD" "$MCRESP" "$MCHEADERS" "$MCAUTH" "$MCDATA" | grep 'X-Subject-Token' | sed "s/^.*: //")
374 #TOKEN=$(curl -v -s -H "Content-Type: application/json" -X POST -d "{\"tenantName\": \"${DNSAAS_TENANT_ID}\"}" "${MULTICLOUD_PLUGIN_ENDPOINT}/identity/v3/auth/tokens" 2>&1 | grep X-Subject-Token | sed "s/^.*: //")
375 echo "Received Keystone token $TOKEN from $MCURL"
379 ZONENAME="${DCAE_ZONE}.dcaeg2.simpledemo.onap.org."
382 curl -sv -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X GET "${MULTICLOUD_PLUGIN_ENDPOINT}/dns-delegate/v2/zones"
385 echo "Creating zone $ZONENAME"
386 curl -sv -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X POST -d "{ \"name\": \"$ZONENAME\", \"email\": \"lji@research.att.com\"}" "${MULTICLOUD_PLUGIN_ENDPOINT}/dns-delegate/v2/zones"
388 ### query the zone with zone name
389 curl -s -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X GET "${MULTICLOUD_PLUGIN_ENDPOINT}/dns-delegate/v2/zones?name=${ZONENAME}"
393 ZONEID=$(curl -v -s -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X GET "${MULTICLOUD_PLUGIN_ENDPOINT}/dns-delegate/v2/zones?name=${ZONENAME}" |sed 's/^.*"id":"\([a-zA-Z0-9-]*\)",.*$/\1/')
394 echo "After creation, zone $ZONENAME ID is $ZONEID"
396 ### query the zone with zone id
397 echo "Test listing zone info for zone $ZONENAME"
398 curl -sv -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X GET "${MULTICLOUD_PLUGIN_ENDPOINT}/dns-delegate/v2/zones/${ZONEID}"
404 local CLOUD_OWNER='pod25'
406 local CLOUD_VERSION='titanium_cloud'
409 local DNSAAS_TENANT_ID
412 local MCMETHOD='-X GET'
414 local MCHEADERS='-H "Real-Time: true" -H "Content-Type: application/json" -H "Accept: application/json"'
417 local MULTICLOUD_PLUGIN_ENDPOINT
419 CLOUD_REGION="$(cat /opt/config/openstack_region.txt)"
420 CLOUD_ENV="$(cat /opt/config/cloud_env.txt)"
421 DCAE_ZONE="$(cat /opt/config/dcae_zone.txt)"
422 DNSAAS_TENANT_ID="$(cat /opt/config/dnsaas_tenant_id.txt)"
423 MCHOST=$(cat /opt/config/openo_ip_addr.txt)
424 MCURL="http://$MCHOST:9005/api/multicloud-titanium_cloud/v0/swagger.json"
426 MULTICLOUD_PLUGIN_ENDPOINT=http://${MCHOST}/api/multicloud-titanium_cloud/v0/${CLOUD_OWNER}_${CLOUD_REGION}
427 MULTICLOUD_PLUGIN_ENDPOINT=http://${MCHOST}:9005/api/multicloud-titanium_cloud/v0/${CLOUD_OWNER}_${CLOUD_REGION}
431 TOKEN=$(curl -v -s -H "Content-Type: application/json" -X POST -d "{\"tenantName\": \"${DNSAAS_TENANT_ID}\"}" "${MULTICLOUD_PLUGIN_ENDPOINT}/identity/v3/auth/tokens" 2>&1 | grep X-Subject-Token | sed "s/^.*: //")
434 ZONENAME="$1.dcae.simpledemo.onap.org."
436 ZONEID=$(curl -v -s -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X GET "${MULTICLOUD_PLUGIN_ENDPOINT}/dns-delegate/v2/zones?name=${ZONENAME}" |sed 's/^.*"id":"\([a-zA-Z0-9-]*\)",.*$/\1/')
438 curl -s -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X DELETE "${MULTICLOUD_PLUGIN_ENDPOINT}/dns-delegate/v2/zones/${ZONEID}"
443 local CLOUD_OWNER='pod25'
445 local CLOUD_VERSION='titanium_cloud'
448 local DNSAAS_TENANT_ID
451 local MCMETHOD='-X GET'
453 local MCHEADERS='-H "Real-Time: true" -H "Content-Type: application/json" -H "Accept: application/json"'
456 local MULTICLOUD_PLUGIN_ENDPOINT
458 CLOUD_REGION="$(cat /opt/config/openstack_region.txt)"
459 CLOUD_ENV="$(cat /opt/config/cloud_env.txt)"
460 DCAE_ZONE="$(cat /opt/config/dcae_zone.txt)"
461 DNSAAS_TENANT_ID="$(cat /opt/config/dnsaas_tenant_id.txt)"
462 MCHOST=$(cat /opt/config/openo_ip_addr.txt)
463 MCURL="http://$MCHOST:9005/api/multicloud-titanium_cloud/v0/swagger.json"
465 MULTICLOUD_PLUGIN_ENDPOINT=http://${MCHOST}/api/multicloud-titanium_cloud/v0/${CLOUD_OWNER}_${CLOUD_REGION}
466 MULTICLOUD_PLUGIN_ENDPOINT=http://${MCHOST}:9005/api/multicloud-titanium_cloud/v0/${CLOUD_OWNER}_${CLOUD_REGION}
470 TOKEN=$(curl -v -s -H "Content-Type: application/json" -X POST -d "{\"tenantName\": \"${DNSAAS_TENANT_ID}\"}" "${MULTICLOUD_PLUGIN_ENDPOINT}/identity/v3/auth/tokens" 2>&1 | grep X-Subject-Token | sed "s/^.*: //")
473 ZONENAME="$1.dcae.simpledemo.onap.org."
475 ZONEID=$(curl -v -s -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X GET "${MULTICLOUD_PLUGIN_ENDPOINT}/dns-delegate/v2/zones?name=${ZONENAME}" |sed 's/^.*"id":"\([a-zA-Z0-9-]*\)",.*$/\1/')
477 curl -v -s -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X GET "${MULTICLOUD_PLUGIN_ENDPOINT}/dns-delegate/v2/zones/${ZONEID}/recordsets"
484 NEXUS_USER=$(cat /opt/config/nexus_username.txt)
485 NEXUS_PASSWORD=$(cat /opt/config/nexus_password.txt)
486 NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt)
487 DOCKER_VERSION=$(cat /opt/config/docker_version.txt)
488 ZONE=$(cat /opt/config/dcae_zone.txt)
489 RANDSTR=$(cat /opt/config/rand_str.txt)
490 MYFLOATIP=$(cat /opt/config/dcae_float_ip.txt)
491 MYLOCALIP=$(cat /opt/config/dcae_ip_addr.txt)
492 TENANTNAME=$(cat /opt/config/tenant_name.txt)
493 OSUSERNAME=$(cat /opt/config/openstack_user.txt)
494 OSPASSWORD=$(cat /opt/config/openstack_password.txt)
497 #########################################
498 # Wait for then register with A&AI
499 ########################################
501 DNSAAS_PROXYED=$(tr '[:upper:]' '[:lower:]' < /opt/config/dnsaas_config_enabled.txt)
502 if [ "$DNSAAS_PROXYED" == 'true' ]; then
503 echo "Using proxyed DNSaaS service, performing additional registration and configuration"
506 register_multicloud_pod25_with_aai
507 register_multicloud_pod25dns_with_aai
509 verify_multicloud_registration
511 wait_for_multicloud_ready
512 register_dns_zone "$ZONE"
513 echo "Registration and configuration for proxying DNSaaS completed."
515 echo "Using proxyed DNSaaS service, performing additional registration and configuration"
522 #########################################
523 # Start DCAE Bootstrap container
524 #########################################
526 chmod 777 /opt/app/config
527 rm -f /opt/config/runtime.ip.consul
528 rm -f /opt/config/runtime.ip.cm
531 docker login -u "$NEXUS_USER" -p "$NEXUS_PASSWORD" "$NEXUS_DOCKER_REPO"
532 docker pull "$NEXUS_DOCKER_REPO/onap/org.onap.dcaegen2.deployments.bootstrap:$DOCKER_VERSION"
533 docker run -d --name boot -v /opt/app/config:/opt/app/installer/config -e "LOCATION=$ZONE" "$NEXUS_DOCKER_REPO/onap/org.onap.dcaegen2.deployments.bootstrap:$DOCKER_VERSION"
536 # waiting for bootstrap to complete then starting nginx for proxying healthcheck calls
537 echo "Waiting for Consul to become accessible"
538 while [ ! -f /opt/app/config/runtime.ip.consul ]; do echo "."; sleep 30; done
542 # start proxy for consul's health check
543 CONSULIP=$(head -1 /opt/config/runtime.ip.consul | sed 's/[[:space:]]//g')
544 echo "Consul is available at $CONSULIP"
546 cat >./nginx.conf <<EOL
549 server_name dcae.simpledemo.onap.org;
550 location /healthcheck {
551 proxy_pass http://${CONSULIP}:8500/v1/health/state/passing;
555 docker run --name dcae-proxy -p 8080:80 -v "$(pwd)/nginx.conf:/etc/nginx/conf.d/default.conf" -d nginx
556 echo "Healthcheck API available at http://${MYFLOATIP}:8080/healthcheck"
557 echo " or http://${MYLOCALIP}:8080/healthcheck"