Skip to content

Instantly share code, notes, and snippets.

@Gedrovits
Created December 27, 2016 14:06
Show Gist options
  • Save Gedrovits/ae74acc52b74167ab22039523194386f to your computer and use it in GitHub Desktop.
Save Gedrovits/ae74acc52b74167ab22039523194386f to your computer and use it in GitHub Desktop.
Retriable Ruby bundler
# Source: http://www.zhuwu.me/blog/posts/solve-gem-installation-timeout-when-building-docker-image
N=0
STATUS=1
until [ ${N} -ge 5 ]
do
bundle install --without development test --jobs 4 --deployment && STATUS=0 && break
echo 'Try bundle again ...'
N=$[${N}+1]
sleep 1
done
exit ${STATUS}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment