TeamCity 中的快照依赖和完成构建触发器有什么区别? [英] What is the difference between snapshot dependency and finished build trigger in TeamCity?

查看:20
本文介绍了TeamCity 中的快照依赖和完成构建触发器有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我看来,快照依赖的功能完全取代了 TeamCity 中完成构建触发器的功能.如果它们导致不同的链行为,任何人都可以解释这些方法的效果吗?例如,如果我有一个 A->B

It appears to me that the function of snapshot dependency completely supersedes that of finished build trigger in TeamCity. Can anyone explain more the effect of these methods if they result in different chain behaviour? As an example, if I had a build chain of A->B

这三种设置之间的链实际上有什么不同吗?

Does the chain actually behave any differently between these three setups?

  • 设置 1:B 中 A 的单个完成构建触发器.
  • 设置 2:A 在 B 中的单个快照依赖关系.
  • 设置 3:都完成了 A 的构建触发器和 B 中定义的 A 的快照依赖项.

我知道可以将快照依赖关系视为所有依赖项的AND"操作,而 Finished Build Trigger 的工作方式类似于依赖项之间的OR"操作.但是在顺序链的上下文中,有什么区别吗?

I understand that one can kind of treat Snapshot Dependency as "AND" operation of all the dependees, while Finished Build Trigger works like "OR" operation amongst the dependees. But in the context of a sequential chain, is there any difference?

谢谢,斯科特

推荐答案

快照依赖"和完成构建"触发器有很大不同.一个基本上是推"操作,另一个是拉"操作.

A "Snapshot Dependency" and "Finished Build" trigger are very different. one is basically a "push" operation while the other is a "pull" operation, respectively.

设置 1:如果我有构建配置 AB,其中 BA 上有已完成构建"触发器,那么相反的行为是正确的.触发B不会影响A,但触发A会在完成后有效触发B.

Setup 1: If I have build configs A and B where B has a "Finished Build" trigger on A, then the opposite behavior is true. Triggering B will have no affect on A, but triggering A will effectively trigger B once it has finished.

设置 2:如果我有完全相同的设置,但 BA 有快照依赖关系,那么每当触发 B 时,A 将首先运行,或者至少在运行 B 之前检查它是否需要运行.如果只触发A,则不会触发B.

Setup 2: If I have the exact same setup but instead B has a snapshot dependency on A, then whenever B is triggered, A will run first, or at least check to see if it needs to run, before running B. IF only A is triggered, then B will not be triggered.

设置 3:设置 3 略有不同,因为它不仅仅依赖于Finished Build"触发器或快照依赖项.它还取决于初始触发器(VCS、预定或其他).例如,如果您在 A 上有一个 VCS 触发器,而 BA 上有已完成构建"触发器和快照依赖项",那么您有效地获得了设置 1 的行为.A 将在 VCS 更改时触发,B 将在 A 之后触发(使用相同的快照).事实上,如果没有快照设置,就不能保证 B 将使用与 A 相同的快照,这可能是也可能不是您想要的.

Setup 3: Setup 3 is slightly different because it doesn't JUST depend on the "Finished Build" trigger or the snapshot dependency. it ALSO depends on the initial trigger (VCS, scheduled, or whatever). for example, if you have a VCS trigger on A, and B has both the "Finished Build" trigger and "snapshot dependency" on A, then you effectively get the behavior of Setup 1. A will get triggered on VCS changes and B will be triggered AFTER A (using the same snapshot). In fact, without the snapshot setup, it is not guaranteed that B will use the same snapshot as A, which may or may not be what you want.

因此,一般来说,当您想要一个从左到右"的触发过程时,您可以同时使用已完成的构建触发器和快照依赖项来保证构建附属物的神圣性.

So in general, when you want a "left-to-right" trigger process, you use BOTH finished build triggers and snapshot dependencies to guarantee the sanctity of the build collateral.

另一方面,如果您在 B 上设置了初始触发器(VCS 或计划或其他),那么完成构建"触发器在某种程度上无效,因为 B 总是会首先触发(但不运行),然后它会触发它的所有依赖项并在它们完成后自动运行.

If, on the other hand, you have your initial trigger (VCS or scheduled or whatever) setup on B, then having the "finished build" trigger is somewhat nullified, because B will always be triggered first (but not run), and then it will trigger all of its dependencies and automatically run after they finish.

希望对您有所帮助.谢谢!

hope that helps. thanks!

这篇关于TeamCity 中的快照依赖和完成构建触发器有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆