Search code examples
azure-devopstfsdevopstfsbuild

TFS build server settings to execute continues build step by step


I am working on TFS continues build which runs after any checkin. I have two more build which run at same time in same checkin. Now I want to force to one of build to wait until other two completed because there is dependency in other two builds.

1: Build1- run

2: Build2- run

3: Build- wait until build1 and build two finished.

Please help


Solution

  • TFS build server settings to execute continues build step by step

    I am afraid there is no such out of box way to achieve this request.

    To resolve this, we could use the REST API in the first step in the current pipeline to loop check the build status of build1 and build2 until the status of build1 and build2 is complete and then continue to run the current pipeline.

    Besides, there is an extension Trigger Build Task. there you have an option Wait till the triggered builds are finished before build continues:

    enter image description here

    If this option is enabled, the script will wait until the all the queued builds are finished. Note: This can take a while depending on your builds and your build will not continue. If you only have one build agent you will even end up in a deadlock situation!

    So, you could enable CI for this pipeline, and add this task to trigger build1 and build2 task:

    enter image description here