TeamCity: Prevent 2 builds from running simultaneously

这一生的挚爱 提交于 2019-12-06 19:28:01

问题


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.

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.


回答1:


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.




回答2:


Keith, there are two plugins that can help you: The first one is Groovy plugin. It has functionality of creating name locks over all projects.

The second one is TeamCity.SharedResources. It has functionality of definig shared resources and locking them with read and write locks. However, resources defined in this plugin, are are defined per-project. We are actively developing this plugin, so you are welcome to watch its page in our tracker




回答3:


In the newest version of TeamCity, you can configure this parameter. Go to the Edit Configuration Settings -> Edit Configuration Settings and set parametr:

Limit the number of simultaneously running builds (0 — unlimited)



来源:https://stackoverflow.com/questions/14468161/teamcity-prevent-2-builds-from-running-simultaneously

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!