diff --git a/scripts/ci/before_install.sh b/scripts/ci/before_install.sh index 1411a4e4c..bb7490a54 100644 --- a/scripts/ci/before_install.sh +++ b/scripts/ci/before_install.sh @@ -3,13 +3,15 @@ set -x set -e +scriptdir="$(dirname $0)" + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ulimit -a sudo sysctl -w kern.maxproc=2048 sudo sysctl -w kern.maxprocperuid=2048 echo '\nulimit -u 2048' >> ~/.bash_profile ulimit -a - brew update + $scriptdir/retry.sh brew update brew upgrade pyenv # NOTE: used to install and run our style checking tools osx_python_ver=3.6.2 @@ -47,7 +49,6 @@ if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then ssh 0.0.0.0 ls &> /dev/null fi -scriptdir="$(dirname $0)" echo > env.sh if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] diff --git a/scripts/ci/install.sh b/scripts/ci/install.sh index cefee81e3..658bf1fd1 100644 --- a/scripts/ci/install.sh +++ b/scripts/ci/install.sh @@ -3,20 +3,14 @@ set -x set -e -N_RETRIES=3 - -function retry { - for i in $(seq $N_RETRIES); do - $@ && break - done -} +scriptdir="$(dirname $0)" # NOTE: it is not uncommon for pip to hang on travis for what seems to be # networking issues. Thus, let's retry a few times to see if it will eventially # work or not. -retry pip install --upgrade pip setuptools wheel -retry pip install .[all,tests] -retry pip install psutil +$scriptdir/retry.sh pip install --upgrade pip setuptools wheel +$scriptdir/retry.sh pip install .[all,tests] +$scriptdir/retry.sh pip install psutil git config --global user.email "dvctester@example.com" git config --global user.name "DVC Tester" diff --git a/scripts/ci/retry.sh b/scripts/ci/retry.sh new file mode 100755 index 000000000..490f92908 --- /dev/null +++ b/scripts/ci/retry.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +N_RETRIES=3 +for i in $(seq $N_RETRIES); do + echo "Attempt #$i" + $@ && exit $? +done + +exit $?