如果有文件更改,是否有办法仅在Teamcity中触发构建?

时间:2017-04-04 13:49:02

标签: teamcity

我们正在使用teamcity和github enterprise。我们将它设置为在合并请求和提交上运行。但是,git会继续为具有0个文件更改的合并发送teamcity提交消息,这会触发构建。

例如,这将触发构建:

enter image description here

I've found the documentation here for creating a trigger filter

但我没有找到一种方法来创建更新文件数量的过滤器。

我认为这是导致构建的原因

  

在分支合并上触发构建   VCS触发器完全了解分支,并在分支中检测到签入后触发构建。   当更改从一个分支合并/快速转发到另一个分支时,严格来说代码中没有实际的更改。默认情况下,VCS触发器的行为方式如下:

 - When merging/fast forwarding of two non-default branches: the changes
   in a build are calculated with regard to previous builds in the same
   branch, so if there is a build on same commit in a different branch,
   the trigger will start a build in another branch pointing to the same
   commit.  
 - If the default branch is one of the branches in the
   merging/fast-forwarding, the changes are always calculated against
   the default branch, if there is a build on same revision in the
   default branch, TeamCity will not run a new build on the same
   revision.

值得注意的是,在未更新的分支上构建将由另一个分支中的合并触发。

1 个答案:

答案 0 :(得分:1)

您可能使用结帐规则。否则,在带有0个文件的合并提交上运行构建似乎是一个合适的操作:提交确实会更改checkout目录的内容并触发构建。

如果您通过TeamCity结帐规则限制结账,TeamCity仅显示包含0个文件的合并提交,如果它实际更改已检出目录的内容(通过合并目录中的文件),或者提交图表不完整TeamCity已知,它可能会影响结账。

如果您没有运行最新的TeamCity版本(截至目前为10.0.5),则更新是有意义的。如果您仍然显示的合并提交不会影响已签出的文件,也不会合并在TeamCity中配置VCS之前创建的提交,则有必要将详细信息报告给TeamCity support

相关问题