Skip to content

Instantly share code, notes, and snippets.

@lpender
Last active April 12, 2018 18:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lpender/f6b55e7f3649db3b6df5 to your computer and use it in GitHub Desktop.
Save lpender/f6b55e7f3649db3b6df5 to your computer and use it in GitHub Desktop.
Multi-pass build script
#!/bin/sh
MAX_TRIES=4
COUNT=0
EXIT=0
while [ $COUNT -lt $MAX_TRIES ] && [ $EXIT -eq 0 ]; do
git log --pretty=format:'%s' -n 1
echo "\nRunning test suite... $COUNT of $MAX_TRIES"
bundle exec rake
let EXIT=$?
let COUNT=COUNT+1
done
exit $EXIT
@lpender
Copy link
Author

lpender commented Oct 26, 2015

Set MAX_TRIES to the number of times you want your build to run.

@map7
Copy link

map7 commented Aug 22, 2017

The first line should be #!/bin/bash under debian otherwise this script will not work. You could make it universal by adding #!/usr/bin/env bash at the top instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment