From 6a4a349a1be3ad5460e507dc4e2098936fd23859 Mon Sep 17 00:00:00 2001 From: "Christopher Lott (cl778h)" Date: Tue, 10 Oct 2017 15:54:38 -0400 Subject: Extend deployment for CSIT env quirks Define new environment variables so a host IP and name can be added to a docker container /etc/hosts file for inter-app comms using the semi-well-known name portal.api.simpledemo.openecomp.org Issue: PORTAL-59 Change-Id: If1c23a77a4b227aac314d966f41e5d5aaad846f8 Signed-off-by: Christopher Lott (cl778h) --- deliveries/wait-for.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'deliveries/wait-for.sh') diff --git a/deliveries/wait-for.sh b/deliveries/wait-for.sh index be9a443f..25258218 100755 --- a/deliveries/wait-for.sh +++ b/deliveries/wait-for.sh @@ -23,19 +23,22 @@ USAGE wait_for() { command="$*" + if [ "$QUIET" -ne 1 ]; then echo "$0: probing host $HOST port $PORT"; fi for i in `seq $TIMEOUT` ; do nc -z "$HOST" "$PORT" > /dev/null 2>&1 result=$? if [ $result -eq 0 ] ; then - if [ "$QUIET" -ne 1 ]; then echo "Operation succeeded on try $i"; fi + if [ "$QUIET" -ne 1 ]; then echo "$0: operation succeeded on try $i"; fi if [ -n "$command" ] ; then + if [ "$QUIET" -ne 1 ]; then echo "$0: exec-ing command $command"; fi exec $command fi exit 0 fi + if [ "$QUIET" -ne 1 ]; then echo "$0: sleeping after try $i"; fi sleep 1 done - echo "Operation timed out" >&2 + echo "$0: Operation timed out" >&2 exit 1 } -- cgit 1.2.3-korg