问题描述
这是我当前Jenkins的一个项目设置:
这种设置使我可以持续自动交付,并在开发过程中持续反馈。前3个工作也运行所有测试和覆盖报告。
问题是我无法找到一种方法从所有开发分支作业中排除主分支。每次我合并pull-request时,它都会不必要地建立master。
有人知道如何从Jenkins中排除一个分支吗?
ps:我使用Git和Github插件。我的项目存储在Github上。
您可以选择反向 b
$ b
检查Jenkins作业配置,
$ b
(不要忘记填写分支机构构建文本字段由主)
另请参阅附件截图图片:
Here is my current Jenkins setup for a project:
- one job runs all development branches
- one job runs all pull requests
- one job runs only the master branch
- one job makes the automated release only when master passes
This setup allows me to have continuous automated delivery as well as constant feedback during development. The first 3 jobs also run all tests and coverage reports.
The problem is that I could not find a way to exclude the master branch from the "all development branches" job. It unnecessarily builds master twice every time I merge a pull-request.
Does anybody know how to exclude one branch from the job in Jenkins ?
ps: I am using the Git and the Github plugins. My project is stored on Github.
You can choose "Inverse" strategy for targeting branches to build.
Check out Jenkins job configuration,
- "Source Code Management" section (choose "Git")
- Additional Behaviours
- click "Add" button
- choose "Strategy for choosing what to build"
- select "Inverse" strategy in combo box.
(Don't forget to fill in "Branches to build" text field by "master")
See also attachment screenshot image:
这篇关于如何从詹金斯的建筑物中排除git分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!