【问题标题】:Is there a way to only trigger a build in Teamcity if there were file changes?如果有文件更改,有没有办法只在 Teamcity 中触发构建?
【发布时间】:2017-04-04 13:49:01
【问题描述】:

我们将 teamcity 与 github 企业一起使用。我们将它设置为在合并请求和提交上运行。但是,git 会不断发送 teamcity 提交消息,用于有 0 个文件更改的合并,这会触发构建。

例如,这将触发构建:

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.

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

【问题讨论】:

    标签: teamcity


    【解决方案1】:

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

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

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

    【讨论】:

    • 这是有道理的。谢谢
    猜你喜欢
    • 1970-01-01
    • 2011-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多