Skip to content

Instantly share code, notes, and snippets.

@davisshaver
Created March 7, 2016 20:02
Show Gist options
  • Save davisshaver/3aef37ccd6e73b207b97 to your computer and use it in GitHub Desktop.
Save davisshaver/3aef37ccd6e73b207b97 to your computer and use it in GitHub Desktop.
Restart latest build of `master` branch on Travis-CI.com
## Example output of travis `#6 passed: master Merge pull request #1 from org/branch-name`
lastrun=$(travis history --pro -r org/repo --limit 1 --branch master)
lastrunarr=(`echo ${lastrun}`)
number=$(echo $lastrunarr[1] | tr -cd '[[:digit:]]')
travis restart $number -r org/repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment