Skip to content

Instantly share code, notes, and snippets.

@Sulverus
Last active August 29, 2015 14:16
Show Gist options
  • Save Sulverus/17dbe2665341031c94c3 to your computer and use it in GitHub Desktop.
Save Sulverus/17dbe2665341031c94c3 to your computer and use it in GitHub Desktop.
Travis pusher
# Travis rebuild pusher
# requires: travispy
# Also you need to have github api token
from travispy import TravisPy
github_token = '[Your github token]'
def travis_auth(token):
return TravisPy.github_auth(token)
def travis_push(travis, repository):
user = travis.user()
repo = travis.repo(repository)
build = travis.build(repo.last_build_id)
return build.restart()
if __name__ == '__main__':
token = travis_auth(github_token)
for repo in ['me/myrepo1', 'me/myrepo2', 'me/myrepo3']:
print '[%s]: %s' % (repo, travis_push(token, repo))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment