The aim of this project is to restart your organization travis CI builds nightly. In case of ONGR, this is useful since symfony bundles depend on each other. This script should be ran as a cronjob once per day. It firstly triggers restarts on all latest travis CI builds for all organization repos (not merges or forks). After this is done, it triggers restarts on the remaining failed or errored builds. ##Installation
The script depends on the TravisCI command-line tool. Installation instructions can be found here. After you've installed travis gem successfully, you need to authenticate against a github account which has access rights to your github organization in order to restart travis CI builds. There are a few methods for doing this. Perhaps the laziest one is with travis login --auto
. For this to work, you need to add your GitHub token to your ~/.github-oauth-token
file first.
The script has to be added as a cronjob to repeat once every 24hours. In order for it to work, you need to add your $PATH to the crontab. The script should be added as follows:
* * * * * /bin/sh /<PATH>/travis-tools.sh <ORGANIZATION_NAME> >> /<PATH>/logfile 2>&1
Here's a working example, assuming you created a separate user to run this cron:
$ crontab -l -u travis-tools
<...>
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
00 23 * * * /bin/bash /home/travis-tools/travis-tools.sh ongr-io >> /home/travis-tools/travis.log 2>&1
- If you are receiving an error while installing travis similar to this:
ERROR: Error installing travis: ERROR: Failed to build gem native extension.
Check out this section. - If you notice the cronjob is not working, try to run the script manually or check your system's cron log (e.g.
/var/log/syslog
/var/log/cron
). - If the script returned errors, they should be found in the logfile you defined in your cronjob.
##License MIT - see the accompanying LICENSE file for details.