Commit 545f42cd authored by Matthew Brett's avatar Matthew Brett
Browse files

Use retry for docker pull command

parent 89c87b8b
......@@ -333,3 +333,21 @@ function get_pypy_build_prefix {
exit 1
fi
}
retry () {
# Retry command (with arguments) up to 5 times
# https://gist.github.com/fungusakafungus/1026804
local retry_max=5
local count=$retry_max
while [ $count -gt 0 ]; do
"$@" && break
count=$(($count - 1))
sleep 1
done
[ $count -eq 0 ] && {
echo "Retry failed [$retry_max]: $@" >&2
return 1
}
return 0
}
......@@ -78,7 +78,7 @@ function build_multilinux {
[ -z "$plat" ] && echo "plat not defined" && exit 1
local build_cmds="$2"
local docker_image=quay.io/pypa/manylinux1_$plat
docker pull $docker_image
retry docker pull $docker_image
docker run --rm \
-e BUILD_COMMANDS="$build_cmds" \
-e PYTHON_VERSION="$MB_PYTHON_VERSION" \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment