'Build has failed' information

Hi guys,

I'm currently running TeamCity Version 3.0.1 EAP (build 5504).

Is there a way to get an internal property or a variable that tells me if the build has failed (without writing a serverside plugin for it)?

The scenario is the following: I want to call an MSBuild task if and only if the build has failed.

Thanks,

Brian

4 comments

Brian,

I am afraid this is not possible. To be precise, the information on build finish status cannot be provided while the build is still running (executing MSBuild task).

I can see the following alternatives here:

- track the build status in the build script itself and set some flag if build fails. The flag can later be analyzed in other tasks. Possibility to do this depends largely on the nature of the script and opportunity to modify the script for this need.

- try to get the build status parsing TeamCity web UI. But this does not seem as a reliable method, I am afraid.

Hope, this helps.

--
Best regards,

Yegor Yarko
Quality Assurance Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Hi Yegor,

Your first strategy works (tracking the build status in the build script).

Thanks for the info :)

Brian

0

Might be nice to offer a failure option for build dependencies. You can
currently trigger a build when another build succeeds, seems it might be
easy enough to enhance that to allow one build to run when another fails.

0

Chris,

If this use case is quite common, this of course can be done. Could you please file a Jira request for it?

To fully address the issue we will need to enhance the dependency triggering UI and provide a way to get the status of the original build somehow. This can be addressed as part of much anticipated composed builds feature ( http://www.jetbrains.net/jira/browse/TW-2608 ). The feature was excluded from our original plan for the nearest release. I hope, it will be available in one of the next releases.

--
Best regards,

Yegor Yarko
Quality Assurance Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Please sign in to leave a comment.