Skip to content

Commit

Permalink
Retry docker pull in tests if it fails. (#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarrick-mesosphere authored Jul 9, 2019
1 parent 31b453e commit 6ede82d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/bin/sh

# Pull the builder image with retries if it doesn't already exist.
retries=0
builder_image=$(grep FROM test/Dockerfile | awk '{print $2}')

if ! docker inspect "$builder_image"; then
until docker pull "$builder_image"; do
if [ retries -eq 3 ]; then
echo "Giving up downloading builder image, failing build."
exit 1
fi
echo "Docker pull failed, retrying."
((retries++))
sleep 1
done
fi

docker build -f test/Dockerfile -t kudo-test .
if [ $? -eq 0 ]
then
Expand Down

0 comments on commit 6ede82d

Please sign in to comment.