retrigger build based on output

We have an intermittent error that comes up in one of our builds, and running the build again usually fixes it.  We're working on a solution to this problem, but in the interim I'd like to see if I could post-process the build output, look for the particular error, and retrigger the build.  Is this functionatliy something I could build a teamcity plugin for?  Is is possible?  Seems like functionality that might already exist somewhere, so maybe I'm missing something.

4 comments
Comment actions Permalink

George,

There is no such feature (yet) available. Feel free to file a feature request on that.

As to writing a custom plugin, it should be possible to write a custom build trigger. You can find more details in the doc.

A build-level approach might be to catch the condition inside the build, and trigger another build via HTTP.

0
Comment actions Permalink

Thanks, I'll check out those docs.  I wonder how I might go about catching the condition during the build.  Right now I'm using the msbuild build runner, but I suspect I would need to move to the command line or script runner.  Then just run msbuild myself and parse output?  Is there any way to parse the output and still use the msbuild runner(it is convenient)?

0
Comment actions Permalink

George,

One of the approaches is to do it entirely on server-side by parsing all the messages logged by the build.

e.g. you can plug into BuildServerListener.messageReceived
then filter the builds to listen to (e.g. only consider those with a specific configuration parameter set) and store the necessary flag (e.g. "retrigger") for the build. THe Build trigger then check the falg and do the job.

This is probably the simpliest, but if the parsing is not lightweight, other approaches might be used, like parsing the messages on the agent or analyzing the entire log after build finish.

0
Comment actions Permalink

Great, server side sounds like what I'm looking for.  I'll investigate that.  Thanks!

0

Please sign in to leave a comment.