Is there a way in TFS 2015 to have two builds such that the second build gets triggered whenever the first one finishes (successfully)? There are solutions for the old XAML based build system, but nothing for the new script-based system, which is what I'm using.
I achieved the "chaining" of builds by creating a custom BuildTask which basically just makes the appropriate calls to the TFS REST Api. It allows me then to define a build definition (by name) that I want to trigger and on top add some conditions (for example check if there is a build of this definition already queued or check if the last build of a certain definition was successful).
If there is any interest, I uploaded the source code to github.
Using tfx you can upload the task to your TFS see details here
In short just grab the files from github, install tfx via node and run
tfx build tasks upload --task-path ./triggerbuildtask
After this you can select the Trigger new Build Task and configure it:
Hope this may help some people that try to achieve the same thing.
Edit
I packaged the task and published it on the Marketplace, so it makes it easy to use the task in your environment:
Trigger Build Task
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With