Friday, April 29, 2016

How to execute power shell script when a build is stopped in build explorer

Leave a Comment

I have got a requirement wherein I need to execute a PowerShell script when someone stops a running build in TFS -> Build explorer.

Is there any event or method that I can hook my code into to achieve that?

For far I only know Pre & Post build events but those wont help me here.

Note: we are using TFS for source control and for builds. And using Octopus Deploy for development on various environments.

1 Answers

Answers 1

Write TFS Server side plugin, which can monitor for that information by subscribing to the events you're interested of.

If you google for "how to create TFS server side plugins" you'll find plenty tutorials how to create one.

For ex: https://roadtoalm.com/2012/03/29/create-tfs-event-subscription-programmatically-with-tfs-api/

You could subscribe to BuildStatusChangedEvent event, and then do something.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment