[英]Build branch separately and merge into master on pull request
Currently I have a Webhook from my Git platform to Jenkins such that every time a pull request is made, the master is built. 目前,我有一个从Git平台到Jenkins的Webhook,以便每次发出拉取请求时,都会构建主数据库。
I would like: 我想要:
1.Build the branch with the changes. 1.使用更改构建分支。
2.Merge the branch with master and build master. 2.将分支与master合并并构建master。
In the project configuration, under " Source Code Management " and " Branch Specifier ", I filled in: 在项目配置中,在“ 源代码管理 ”和“ 分支指定符 ”下,填写:
master
In this case only the master branch is built, but not the one with changes. 在这种情况下,仅构建主分支,而不构建具有更改的分支。
When I leave the option blank, all the branches are built, instead of just the one with changes and master. 当我将该选项留为空白时,将构建所有分支,而不仅仅是具有更改和主分支的分支。
Merge before build
functionality of Git Plugin solves exactly this issue. Merge before build
的Git插件 Merge before build
功能可以解决此问题。
On your job leave the Branch Specifier
blank. 在您的工作中,将“ Branch Specifier
留空。 Then on Additional Behaviours
choose Merge before build
and set master as Branch to merge to
, so your branch with the changes will be merged into master prior the build. 然后在“ Additional Behaviours
选择“ Merge before build
,并将master设置为Branch to merge to
,这样您所做的更改将在构建之前合并到master中。
If you then want this merge to be pushed to your repository, choose on the Post-Builds
the Git Publisher
and configure it as you prefer. 如果您随后希望将此合并推送到您的存储库,请在Post-Builds
的Git Publisher
选择,并根据需要进行配置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.