Skip to content

Commit

Permalink
add authentication to wait-for-url script
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiquan Zhou committed Oct 11, 2017
1 parent 87e3be5 commit 94d9d09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ script:
- cd test/
- chmod +x check-for-docker-url.sh
- ./wait-for-url.sh http://localhost:9070/DecisionRunner
- ./wait-for-url.sh http://localhost:9090/DecisionService
- ./wait-for-url.sh http://localhost:9090/DecisionService resExecutor resExecutor
- ./wait-for-url.sh http://localhost:9060/decisioncenter
- ./wait-for-url.sh http://localhost:9060/teamserver
- ./wait-for-url.sh http://localhost:9080/res
Expand Down
10 changes: 8 additions & 2 deletions test/wait-for-url.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

echo "Testing url $1 availabilty."

if [ $# -ge 3 ]
then
echo "authentication is enabled."
auth="-u $2:$3"
fi

i=0
until $(curl --connect-timeout 180 --output /dev/null --silent --head --fail $1); do
until $(curl $auth --connect-timeout 180 --output /dev/null --silent --head --fail $1); do
i=$((i+1))
if [[ $i -gt 10 ]]; then
printf 'X'
Expand All @@ -13,4 +19,4 @@ until $(curl --connect-timeout 180 --output /dev/null --silent --head --fail $1)
sleep 15
done

printf "OK"
printf "OK"

0 comments on commit 94d9d09

Please sign in to comment.