[7.x] Automatically retry 'docker pull' on CI

This commit is contained in:
Seth Michael Larson
2020-07-29 15:40:25 -05:00
committed by Seth Michael Larson
parent 33c1650b64
commit eaa8334e54
+10
View File
@@ -157,6 +157,16 @@ fi
echo -e "\033[34;1mINFO:\033[0m Starting container $NODE_NAME \033[0m"
# Pull the container, retry on failures up to 5 times with
# short delays between each attempt. Fixes most transient network errors.
docker_pull_attempts=0
until [ "$docker_pull_attempts" -ge 5 ]
do
docker pull docker.elastic.co/elasticsearch/"$ELASTICSEARCH_VERSION" && break
docker_pull_attempts=$((docker_pull_attempts+1))
sleep 10
done
set -x
docker run \
--name "$NODE_NAME" \