Skip to content

Commit

Permalink
Ensure EXIT_CODE is set. Kill Galaxy for local testing
Browse files Browse the repository at this point in the history
Also properly initialise $i and use POSIX syntax
  • Loading branch information
nsoranzo committed Aug 11, 2016
1 parent 8930476 commit a9e0433
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .ci/first_startup.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/bash
#!/bin/sh
TRIES=120
URL=http://localhost:8080
EXIT_CODE=1
i=0
echo "Testing for correct startup:"
bash run.sh --daemon && \
while [[ $i -le $TRIES ]]
do
curl "$URL" && EXIT_CODE=0 && break
sleep 1
EXIT_CODE=1
((i = i + 1))
done
while [ "$i" -le $TRIES ]; do
curl "$URL" && EXIT_CODE=0 && break
sleep 1
i=$((i + 1))
done
kill -9 "$(cat paster.pid)"
echo "exit code:$EXIT_CODE, showing startup log:"
cat paster.log
exit $EXIT_CODE

0 comments on commit a9e0433

Please sign in to comment.