Restarting Travis jobs (almost) automatically

I was sick and tired of having to click all of the failed Travis jobs. Here's a couple of one-liners that you can add as bookmarks to restart all of the failed jobs.

To use it, add the snippet as a bookmark and then click it when you're on your build page. You won't go anywhere, but you should soon see a message saying your jobs have been restarted.

javascript:(function(){var classes = document.getElementsByClassName('jobs-item failed'); for (var i = 0; i < classes.length; i++) { classes[i].getElementsByClassName('action-button--restart')[0].click(); }})();

And if you want to restart only cancelled jobs, that's easy too.

javascript:(function(){var classes = document.getElementsByClassName('jobs-item canceled'); for (var i = 0; i < classes.length; i++) { classes[i].getElementsByClassName('action-button--restart')[0].click(); }})();

I've deliberately not included the error tests because you'll probably want to investigate the logs from those ones to see what went wrong.

Posted Thursday March 22nd, 2018