We are using the new style TFS builds (Build vNext) to run our build orchestration. I am looking for a way to stop our builds if certain preconditions are not met. However, I can't find a way to stop the currently executing build without adding a variable and adding conditional logic in rest of the tasks. Is there a better way of stopping currently executing build? We are using TFS 2017 Update 2.
Asked
Active
Viewed 479 times
1 Answers
0
You can put an in-line PowerShell task in the build with whatever logic you want -- if the exit code is non-0, the build will fail. If the down-stream tasks have "continue on error" off, they won't run.

Daniel Mann
- 57,011
- 13
- 100
- 120
-
1Yes, I was looking for a better way of doing it. Not fail the build and skip the rest of the tasks. I can use the new conditional tasks feature but that again will iterate through all the tasks. – Hamid Shahid Aug 15 '17 at 23:03