简体   繁体   中英

Is there a way to use Jenkins with Github Pull Requests?

I want Jenkins to automatically find and run the test suite for every branch that is part of an open pull request. Is this possible with some Jenkins plugin I have not found?

A new plugin has been released recently for Jenkins—Github pull request builder .

If it does what it says on the tin it's probably what you want.

I found the Jenkins Github pull request builder plugin unusable, so I wrote a little daemon that synchronizes Jenkins jobs with PRs, then comments build status back to each PR's comment thread. You can find it here: https://github.com/percolate/jennifer

One method that should work is you could rename the branch when it is "prepared for integration" and ready to be tested.

A naming convention like prep/my_feature.

Then in the Jenkins git plugin you can configure the branch names that you want it to look at for building. You can have it match 'prep/*'.

We used to do this for all our feature branches using a prefix of 'dev/' to mark the feature branches that should have the autobuild run for them. Seems to work pretty well.

I did something similar, but where Jennifer is a node.js app, Jently is a Ruby app. You can find it at https://github.com/vaneyckt/Jently .

If you happen to be using Cloudbees, they offer their own pull request builder plugin.

https://wiki.cloudbees.com/bin/view/DEV/Github+Pull+Request+Validation

The advantages they tout over the standard Jenkins Github pull request builder is that it runs as a "tenant-isolate" program, preventing the code in the pull request from snooping around for passwords or ssh keys. I could see this being particularly useful for a public project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM