“在快照依赖关系发生变化时触发”似乎无法正常工作
我正在将 TeamCity 6.5.1 与一个项目和大约 10 个构建配置一起使用。我有一个类似于 Core -> 的依赖链框架->应用程序。 Framework 依赖于 Core,App 也依赖于 Core 和 Framework。
我遇到的问题是,在核心被触发并成功构建后,框架/应用程序没有被触发。我在框架和所有应用程序上选择了“触发快照依赖项的更改”,但即使核心构建是从 SVN 提交触发的,它们似乎都不会触发。
“触发快照依赖项的更改”是否不像我想象的那样工作?我是否需要将核心(和框架)VCS 根添加到框架/应用程序上的 VCS 触发器?如果这是我唯一的选择,我想我可以这样做,但这似乎是多余的(特别是如果我将来需要调整 VCS 根路径)。
核心 VCS 触发器:
+:root=MySVNRoot:/Core/**
框架 VCS 触发器(基于核心的快照):
[x] Trigger on changes in snapshot dependencies
+:root=MySVNRoot:/Framework/**
应用程序 VCS 触发器(基于核心和框架的快照)
[x] Trigger on changes in snapshot dependencies
+:root=MySVNRoot:/Applications/MyApplication/**
I'm using TeamCity 6.5.1 with one project and about 10 build configurations. I have a dependency chain akin to Core -> Framework -> Apps. Framework has a dependency on Core, and the Apps depend on both Core and Framework.
The issue I am having is that the framework/apps are not being triggered after the core has been triggered and built successfully. I have selected "Trigger on changes in snapshot dependencies" on the framework and all the apps, but none of them seem to trigger even though the core build was triggered from an SVN commit.
Does "Trigger on changes in snapshot dependencies" not work the way I think it does? Do I need to add the core (and framework) VCS roots to the VCS trigger on the framework/apps? If that is my only option I suppose I could do it that way, but it seems redundant (especially if I need to adjust VCS root paths in the future).
Core VCS Trigger:
+:root=MySVNRoot:/Core/**
Framework VCS Trigger (snapshot dep. on Core):
[x] Trigger on changes in snapshot dependencies
+:root=MySVNRoot:/Framework/**
App VCS Trigger (snapshot dep. on Core and Framework)
[x] Trigger on changes in snapshot dependencies
+:root=MySVNRoot:/Applications/MyApplication/**
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
决定在框架和应用程序配置上使用“完成构建”触发器。我更希望 VCS 触发器以上述方式工作,但我会一直这样做,直到有人提出更好的替代方案(或者如果“完成构建”触发器确实是最佳选择)。
框架触发器:
应用程序触发器:
Decided to use "Finish Build" triggers on the framework and apps configurations. I would prefer that the VCS trigger worked in the way described above, but I'll go with this until someone can suggest a better alternative (or if "Finish Build" triggers really are the best option).
Framework triggers:
App triggers:
对于任何依赖项情况,要使用的功能是快照依赖项。
在您的情况下,您可能应该添加从框架到核心以及从应用程序到框架的 TeamCity 快照依赖项。
之后,“触发快照依赖项的更改”选项将开始工作,根据 Core 中的任何更改触发框架和应用程序。
For any dependency cases the feature to use is snapshot dependencies.
In your case you should probably add TeamCity snapshot dependency from Framework to Core and from Apps to Framework.
After that "Trigger on changes in snapshot dependencies" option will start working triggering Framework and Apps on any change in Core.
您的框架VCS触发器(快照)应该与核心相同,您希望它在核心源更改时触发构建应用
程序VCS触发器应该针对核心和应用程序VCS触发器。框架 VCS
这些设置在 TeamCity 7 中要容易得多
Your Framework VCS Trigger (snapshot) should be the same as core, you want it to TRIGGER the build when Core source changes
App VCS Trigger should be against Core & Framework VCS
These settings are much easier in TeamCity 7
“根据快照依赖项的变化触发构建”功能的作用与听起来相反。对我来说,期望的结果是这样的:
我希望 Core 中的更改触发 Framework 的构建,最终触发 Apps 的构建,但我不希望 Framework 中的更改触发 Core 中的更改,同时仍然触发 Apps 中的构建。
这听起来像是“根据快照依赖项的更改触发构建”功能的作用,但实际上它所做的是在链的开头触发构建,无论更改发生在哪个项目中:
这意味着如果您在应用程序中更改了某些内容,您将触发核心中的构建,并通过快照依赖项,它最终将构建链中的所有内容。我认为这对您不起作用的原因是因为必须在应用程序中设置该触发器,而在任何其他项目上都没有触发器。
不幸的是,我认为实现我所描述的行为的唯一方法是在每个依赖项目上都有一个 VCS 触发器和 Finish Build 触发器,以及一个安静期,这样您就可以从链中间的某个位置独立触发构建,而不会触发整个项目建立链。
The "Trigger a build on changes in snapshot dependencies" feature sort of does the opposite of what it sounds like. For me the desired outcome was like this:
I wanted changes in Core to trigger a build for Framework, and ultimately Apps, but I did NOT want a change in Framework to trigger a change in Core, while still triggering a build in Apps.
That is what it sounds like the "Trigger a build on changes in snapshot dependencies" feature would do, but in reality what it does is trigger a build at the beginning of the chain, regardless of which project the change occurred in:
That would mean if you changed something in Apps, you would trigger a build in Core and through snapshot dependencies, it would ultimately build everything in the chain. I think the reason that didn't work for you is because that trigger has to be set in Apps, with no triggers on any of the other projects.
Unfortunately, I think the only way to achieve the behavior I described is to have a VCS Trigger and Finish Build trigger on each dependent project, and a quiet period so you can independently trigger builds from somewhere in the middle of the chain without triggering the entire build chain.