GithubHelp home page GithubHelp logo

hubb / travis_dedup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grosser/travis_dedup

0.0 2.0 0.0 55 KB

Stop all builds on the same PR when a new job starts

License: MIT License

Ruby 100.00%

travis_dedup's Introduction

Logo

Stop all builds on the same PR when a new job starts.

Setup alternatives

  • A: using travis-dedup.herokuapp.com with github hooks
  • B: self hosting with github hooks
  • C: directly via .travis.yml

A: Using travis-dedup.herokuapp.com via github push notification

Pro: simple / fast
Con: your travis token is sent via the web to a hosted service

  • Go to Github settings
  • Click Generate new token, use name Travis Dedup with scopes repo (all) and user (all)
  • Generate an access token curl -X POST "https://api.travis-ci.com/auth/github" -d "github_token=YOUR_GITHUB_TOKEN"
  • setup github webhook hook to https://travis-dedup.herokuapp.com/github?repo=your_org/your_repo&token=YOUR_ACCESS_TOKEN
  • add &pro=true if you are using travis.com / private travis
  • add &branches=true if you also want to dedup builds on branches (like master or others) The hook sleeps for 5s before inspecting the builds so the newly pushed build are found too.

B: Self hosting on heroku

Pro: travis token is never sent over the web
Con: more complicated

  • If TRAVIS_ACCESS_TOKEN is set, token parameter is no longer required
  • Deploy
  • See A, but use your own heroku subdomain

C: directly via .travis.yml

Pro: no webservice required / token stays on travis
Con: slow to install gem / complicated with multiple envs

  • encrypt token travis encrypt TRAVIS_ACCESS_TOKEN=YOUR_ACCESS_TOKEN
  • add it to your .travis.yml
  • Make your first build step:
before_install: gem install travis_dedup && travis-dedup your_org/your_repo $TRAVIS_ACCESS_TOKEN --pro

With multiple envs in matrix

  • use global: + matrix:
  • use something like matrix: GROUP=misc + before_install: "([ $GROUP = 'misc' ] && gem i travis_dedup && travis-dedup ... ) || [ $GROUP != 'misc' ]"

optionally generate the token at runtime via curl, but keeping the access token around is far less dangerous

Author

Michael Grosser
[email protected]
License: MIT
Build Status

travis_dedup's People

Contributors

grosser avatar untitaker 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.