summaryrefslogtreecommitdiffstats
path: root/deliveries/wait-for.sh
diff options
context:
space:
mode:
authorChristopher Lott (cl778h) <clott@research.att.com>2017-10-10 15:54:38 -0400
committerChristopher Lott (cl778h) <clott@research.att.com>2017-10-10 15:55:51 -0400
commit6a4a349a1be3ad5460e507dc4e2098936fd23859 (patch)
treeea66e04551023fe6b5cc49fa7c9f3d504a815a86 /deliveries/wait-for.sh
parent18f397918fb3139902e131772af6f400a7692e6f (diff)
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) <clott@research.att.com>
Diffstat (limited to 'deliveries/wait-for.sh')
-rwxr-xr-xdeliveries/wait-for.sh7
1 files changed, 5 insertions, 2 deletions
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
}