Taking action on a cancelled build

On our build server, I would like to be able to take certain actions (such as running a batch file), if a build is cancelled.  The batch file would be configured per project.  The reason for this is that our projects use COM objects, and if the build is cancelled I would like to run a script to unregister the objects that were built, so that there is a "clean" environment left behind.  Is there a way to do this through a plug-in or any other method?

3 comments
Comment actions Permalink

Can this be done before build, i.e. before every build of such type COM objects are cleaned?

0
Comment actions Permalink

Unfortunately that won't work...  We have multiple projects that can conflict if not cleaned up...  So a cancelled build of project A can cause the build of project B to break.  A pre-build event would mean project B would have to be aware of all other projects.

0
Comment actions Permalink

Then you won't be able to solve this problem completely, because build can be cancelled/killed before cleanup or agent can be killed or rebooted and so on. You can also write a plugin for agent or create separate build configuration which will perform full cleanup and make your builds depended on this build configuration by snapshot dependency.

0

Please sign in to leave a comment.