Skip to content

Commit 5b6507b

Browse files
committed
Add a timeout waiting for Octopus, and if it fails, print a message with instructions on how to get the octopus log files.
1 parent 3e6fde7 commit 5b6507b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

initdemo.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,16 @@ docker compose -f docker/compose.yml exec octopus sh -c 'curl -sSL -o argocd-lin
445445

446446
# Wait for the Octopus server.
447447
echo "Waiting for the Octopus server"
448-
until curl --output /dev/null --silent --fail http://localhost:18080/api
448+
max_retry=24
449+
counter=0
450+
exit_code=1
451+
until [[ "${exit_code}" == "0" ]]
449452
do
450-
printf '.'
451-
sleep 5
453+
[[ counter -eq $max_retry ]] && echo "Failed!" && echo "Check the Octopus logs with:" && echo "docker logs octopus" && exit 1
454+
[[ counter -ne 0 ]] && sleep 5
455+
((counter++))
456+
curl --output /dev/null --silent --fail http://localhost:18080/api
457+
exit_code=$?
452458
done
453459

454460
echo ""

0 commit comments

Comments
 (0)