Add some resilience to the travis-ci job so that if rubygems is temperamental or...
[buildr.git] / ci-setup.sh
1 update_bundler() {
2 gem list | grep 'bundler' &> /dev/null
3 if [ $? -gt 0 ]; then
4 gem install bundler
5 fi
6 if [ "$1" = 'quiet' ]; then
7 bundle install --deployment > /dev/null 2> /dev/null
8 else
9 bundle install --deployment
10 fi
11 }
12
13 i="0"
14
15 until (bundle check > /dev/null 2> /dev/null) || [ $i -gt 10 ]; do
16 echo "Bundle update. Attempt: $i"
17 update_bundler 'quiet'
18 i=$[$i+1]
19 done
20
21 if !(bundle check > /dev/null 2> /dev/null); then
22 echo "Last Bundle update attempt."
23 update_bundler
24 fi