Giter VIP home page Giter VIP logo

travis-activate's Introduction

travis-activate.py

If you have a GitHub project with an ever-growing number of repos, and you want to automatically activate those repos for Travis-CI builds without having to manually click all the switches on their web site, then this script is for you.

Installation

  1. If you haven't already done this, you'll first need to pip install requests for a necessary library.

  2. You need to get a "token" for Travis-CI, which isn't the same thing as the "token" that Travis-CI displays when you log into it. (Why? No idea.)

  3. First, get a GitHub token with all the "Repo" privileges. You do this on the GitHub website (instructions).

  4. Install the httpie command-line tool.

  5. Run this one-liner, or something like it with your favorite alternative tool, telling Travis your GitHub API token and returning you a Travis-API token. (Replace "XXXXX" with your GitHub API token.)

http POST https://api.travis-ci.com/auth/github github_token=XXXXX
  1. Now you'll have a Travis API token. Edit the travis-activate.py script and paste it at the top where the code says travisToken = . (If you're doing this for multiple repos, you could presumably modify this script to take the token as an external argument. We're more interested in having a script that "just works" without any environmental dependencies.)

  2. Edit the githubProject string to reflect your project's name (e.g., for https://github.com/RiceComp215, the project name is RiceComp215). You should also write a suitable regular expression in repoRegex, specifying which repos you want to include. Non-matching repos will be ignored.

Usage

Now you can simply run python travis-activate.py and it will both activate any previously inactive repos (matching the regex) and will request a rebuild for them. Easy! Run it from a cron script? Sure! Note that this script requests that Travis synchronize itself with GitHub, but this request appears to be asynchronous, so a single run of this script might still miss some recently created repositories.

travis-activate's People

Contributors

danwallach avatar ricpelo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.