[英]TeamCity building specific branch on pull request
I have a solution that consists of several projets like this:我有一个由几个这样的项目组成的解决方案:
MySolution
-Project1
-Project2
-Project3
For each project I have a branch on github, for example Project1Branch, Project2Branch... I have configured triggers on teamcity for builing containers on pullrequest into master.对于每个项目,我在 github 上都有一个分支,例如 Project1Branch、Project2Branch ...... But when it happens all three projects are build, though changes are made only in Projeсt1.但是当它发生时,所有三个项目都已构建,尽管仅在 Projeсt1 中进行了更改。 I tried to configure branch filter in triggers for build step +:Project1*
but in doesn't work.我尝试在触发器中为构建步骤+:Project1*
配置分支过滤器,但不起作用。 How can i solve this issue?我该如何解决这个问题?
TL;DR TL;博士
+:*
.将触发器分支过滤器保留为+:*
。Project1Branch
and "target" to master
branches.在拉取请求构建功能中,将“源”配置为Project1Branch
,将“目标”配置master
分支。 For Project1
to build at each MR of Project1Branch
into master
:让Project1Branch
在Project1
的每个 MR 处构建到master
:
Only watch the Project1Branch
branch. Project1Branch
分支。 In your VCS configuration :在您的VCS 配置中:
refs/heads/Project1Branch
默认分支: refs/heads/Project1Branch
Project1Branch
(可选,除非您需要分支过滤的构建步骤)分支规范: Project1Branch
Add the merge-request/...
branches that match your pattern to the watched branches.将与您的模式匹配的merge-request/...
分支添加到被监视的分支。 Pull Request Filtering :拉取请求过滤:
+:refs/heads/Project1Branch
按源分支: +:refs/heads/Project1Branch
+:refs/heads/master
按目标分支: +:refs/heads/master
Trigger on every change in watched branch.触发监视分支中的每个更改。 Triggers :触发器:
+:*
分支过滤器: +:*
If you only want to trigger on MR branches, do Triggers :如果您只想在 MR 分支上触发,请执行Triggers :
+:*
-:Project1Branch
The same goes for Project2
and Project3
. Project2
和Project3
也是如此。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.