I need help configuring TeamCity to work around a problem I'm seeing:
We have 4 projects, each with several build plans. The build plans essentially create a chain of steps (i.e. build pipeline) for each project, including update dependencies, run unit tests, run js tests, and deploy to acceptance (some projects have more). We have 3 build agents configured and each of them can handle any of the projects.
Every now and then, when two commits occur close together but aren't picked up in one batch, our unit tests plan (which is the longest running) is run by two build agents simultaneously. This results in a failure because that build plan requires exclusive access to the database.
How can I configure TeamCity only run one build plan for a project at a time? Conceptually, I want the entire build pipeline for a project to finish before it's starts again for the next commit.
I rather not assign projects to specific agents because a) we have more projects than agents and b) I want builds to start as quickly as possible.