Merge remote-tracking branch 'origin/pr/8'
[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 update #> /dev/null 2> /dev/null
8 else
9 bundle update
10 fi
11 bundle check > /dev/null 2> /dev/null
12 return $?
13 }
14
15 i="0"
16
17 until (bundle check > /dev/null 2> /dev/null) || (update_bundler 'quiet') || [ $i -gt 10 ]; do
18 echo "Bundle update. Attempt: $i"
19 update_bundler 'quiet'
20 i=$[$i+1]
21 done
22
23 if !(bundle check > /dev/null 2> /dev/null); then
24 echo "Last Bundle update attempt."
25 update_bundler
26 fi