简体   繁体   English

触发快照依赖关系以在TeamCity中构建特定分支

[英]Trigger Snapshot Dependency to Build Specific Branch in TeamCity

Let's say I have a project Foo configured with Git VCS root having default branch feature/foo . 假设我有一个项目Foo使用Git VCS root配置了默认分支feature/foo I'd like to have a snapshot dependency on a project Bar that is unit testing every feature branch on the same repo as Foo (ie, the VCS root for Bar has no default branch and is instead watching feature/* ). 我想在项目上有一个快照依赖项,它在与Foo相同的repo上对每个功能分支进行单元测试(即, Bar的VCS根目录没有默认分支,而是正在观看feature/* )。

What I see happening is that Foo can only trigger builds on Bar's <default> branch. 我所看到的是, Foo只能在Bar的 <default>分支上触发构建。 Can I change it so that Bar gets triggered for the right branch? 我可以更改它以便为正确的分支触发Bar吗?

It is impossible to configure VCS root without default branch in TeamCity (see related issue http://youtrack.jetbrains.com/issue/TW-23395 ). 如果没有TeamCity中的默认分支,则无法配置VCS根目录(请参阅相关问题http://youtrack.jetbrains.com/issue/TW-23395 )。 So if you do not define default branch for Bar build configuration it will be set to master by default. 因此,如果您没有为Bar构建配置定义默认分支,则默认情况下它将设置为master。 And if you trigger a build with default branch, all dependencies will be triggered with default branch as well. 如果使用默认分支触发构建,则所有依赖项也将使用默认分支触发。

The solutions is to configure the same branch specification for Foo configuration as for Bar (feature/*). 解决方案是为Foo配置配置与Bar (feature / *)相同的分支规范。 If you run Foo build manually you need to select needed branch using Run Custom Dialog (Changes tab), if you run build using VCS trigger you need to configure Branch filter. 如果手动运行Foo构建,则需要使用“运行自定义对话框”(“更改”选项卡)选择所需的分支,如果使用VCS触发器运行构建,则需要配置分支过滤器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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