Search code examples
tfsbuildvnext

I can start the same build definitions multiple times and they are processed parallel, how can I deny this behavior?


I have created a vNext build definition in TFS 2018. I'm able to queue this build definition many times and they were processed parallel.

This behaviour is not acceptable. If they are processed in order, I can live with it.

Does anyone know which setting I have to setup in the definition?

I'm running a tfs in following environment:

TFS 2018.2 On-Premise
4 Build-Agents with different capabilities
1 Build-Definition which fulfills the capabilities of all agents

It is planned, to have more build definitions. Today, we have only one because we are migrating our xaml-builds to vNext.


Solution

  • On the Triggers tab, check the "Batch Changes While Build is in Progress" option and set the number of concurrent builds to 1.

    However, I would strongly recommend fixing whatever prevents your builds from running in parallel. Builds should ideally be stateless and have no impact on one another.

    You can also set a custom Demand/Capability pair such that only one of your agents satisfies your build definition's requirements.