• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

danwallach/travis-activate: Activates Travis-CI builds for all repos in a given ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

danwallach/travis-activate

开源软件地址:

https://github.com/danwallach/travis-activate

开源编程语言:

Python 100.0%

开源软件介绍:

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.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
levithomason/github-changelog-api: ✔️ Generate a changelog from GitHub issues ...发布时间:2022-06-13
下一篇:
arifszn/gitprofile: 发布时间:2022-06-13
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap