Last active
April 12, 2018 18:33
-
-
Save lpender/f6b55e7f3649db3b6df5 to your computer and use it in GitHub Desktop.
Multi-pass build script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
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
Set
MAX_TRIES
to the number of times you want your build to run.