TeamCity: Prevent 2 builds from running simultaneously

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


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)


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.