Skip to content

Commit b16be57

Browse files
committed
retry ruby-install commands on Jenkins
1 parent 6fdb751 commit b16be57

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

bin/jenkins/install-dependencies

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ then
3737

3838
if [ ! -x /usr/local/bin/ruby-install ]
3939
then
40-
curl -L -o ruby-install-0.8.5.tar.gz https://github.com/postmodern/ruby-install/archive/v0.8.5.tar.gz
41-
tar -xzvf ruby-install-0.8.5.tar.gz
42-
cd ruby-install-0.8.5/
40+
curl -L -o postmodern-ruby-install-f59dd9c.tar.gz https://github.com/postmodern/ruby-install/tarball/f59dd9c
41+
tar -xzvf postmodern-ruby-install-f59dd9c.tar.gz
42+
cd postmodern-ruby-install-f59dd9c/
4343
sudo make install
4444
fi
4545

@@ -78,9 +78,27 @@ then
7878
clang clang-format clang-tidy clang-tools libc++-dev libc++abi-dev || true
7979
fi
8080
ruby-install --version
81-
ruby-install --update || true
82-
ruby-install --jobs=6 --no-reinstall ruby ${CB_RUBY_VERSION} -- ${CB_EXTRAS} || \
83-
ruby-install --jobs=6 --no-reinstall --no-install-deps ruby ${CB_RUBY_VERSION} -- ${CB_EXTRAS}
81+
until ruby-install --update --debug
82+
do
83+
if [ $? != 0 ]
84+
then
85+
sudo rm -rf $HOME/.cache/ruby-install/ruby/*.part
86+
d=$(( RANDOM % 10 + 1 ))
87+
echo "sleep for $d seconds"
88+
sleep $d
89+
fi
90+
done
91+
until ruby-install --debug --jobs=6 --no-reinstall ruby ${CB_RUBY_VERSION} -- ${CB_EXTRAS} || \
92+
ruby-install --debug --jobs=6 --no-reinstall --no-install-deps ruby ${CB_RUBY_VERSION} -- ${CB_EXTRAS}
93+
do
94+
if [ $? != 0 ]
95+
then
96+
sudo rm -rf $HOME/.cache/ruby-install/ruby/*.part
97+
d=$(( RANDOM % 10 + 1 ))
98+
echo "sleep for $d seconds"
99+
sleep $d
100+
fi
101+
done
84102
fi
85103
if [ "$(uname -s)" = "Darwin" ]
86104
then

0 commit comments

Comments
 (0)