Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TeamCity: Prevent 2 builds from running simultaneously

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.

like image 635
Keith Avatar asked Jan 22 '13 21:01

Keith


People also ask

How do I disable builds in TeamCity?

On the Project Settings page, open the Actions menu and click Pause/Activate. In the dialog that opens, clear the box next to the project to activate all its build configurations or clear the boxes of the configurations selectively: the unselected build configurations will be activated.

What is build chain in TeamCity?

A build chain is a sequence of builds interconnected by snapshot dependencies. Sometimes the build chain is called a "pipeline". Parts of a build chain linked with snapshot dependencies with enabled revisions synchronization use the same snapshot of the sources.


1 Answers

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

like image 87
Oleg Rybak Avatar answered Nov 13 '22 13:11

Oleg Rybak