TeamCity:阻止2个构建同时运行 [英] TeamCity: Prevent 2 builds from running simultaneously
问题描述
我不希望Build Config A和Build Config B同时运行.这是因为它们共享无法同时访问的相同资源.但是,每个构建配置均由单独的代理运行,因此它们可以同时运行.
I don't want Build Config A and Build Config B to run at the same time. This is because they share the same resource which cannot be accessed simultaneously. However each build config is run by a separate agent so it is possible for them to run simultaneously.
相反,我希望一个构建配置被触发时,如果另一个正在运行,则等待其他构建完成.例如,如果Build Config B开始运行,但是Build Config A已经在运行,那么B将等待直到A完成,然后B才能运行.
Instead I would like one build config, when triggered, to wait for the other to finish if it is running. For example if Build Config B begins to run but Build Config A is already running, then B would wait until A finishes and then B would run.
我认为快照依赖项不起作用,因为它假定一个配置与另一个配置具有依赖关系,在我的情况下是不正确的.
I don't think a snapshot dependency will work because that assumes one config has a dependency on the other which is not true in my case.
推荐答案
为方便起见,只需在项目的兼容代理"选项卡上制定规则即可.他们必须在包含xxx的代理名称(无论是什么)上运行,然后这些构建只能在该代理上运行,并且永远不会同时运行.
For a quick and dirty, just make a rule on the compatible agents tab for the project. That they have to run on the agent name containing xxx ( whatever that is ) then those builds can only run on that agent and will never run at the same time.
这篇关于TeamCity:阻止2个构建同时运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!