Skip to content

Commit

Permalink
Add debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ganeshrockz committed Dec 5, 2023
1 parent 7be60b7 commit d878028
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions examples/dev-server-fargate/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@

# Script that validates if the setup works E2E on ECS.
set -e
set -x

waitfor() {
echo -n "waiting for ${1} to be registered in Consul"
local count=0
while [[ $count -le 30 ]]; do
echo -n "."
echo $(curl -sS -X GET \
"${CONSUL_HTTP_ADDR}/v1/catalog/services") \
| grep -q "${1}" && return
response=$(curl -sS -X GET "${CONSUL_HTTP_ADDR}/v1/catalog/services")
if [ $? -ne 0 ]; then
echo "Error: curl command failed"
((count++))
continue
fi
echo $response | grep -q "${1}" && return
sleep 10
((count++))
done
Expand Down

0 comments on commit d878028

Please sign in to comment.