Does a build status property exist allow simple notification in "Always run" build steps?

I'd like to see a build status property exposed to build steps, to provide an easy way of writing notification scripts.

Given a build configuration with N steps, I'd like to be able to add step N+1, with Execute="Even if some of previous steps failed", in order to add some custom notification logic (posting to IRC or Campfire or whatever).

Ideally, a property like %build.status% or %teamcity.build.status%, with a value of "SUCCESS"/"FAILED", or maybe just a 1/0 value. *something* that is easily testable in a script. Maybe this status also needs to include a state for "stopped", when someone explicitly stops a build.

From what I can currently tell, TeamCity 7.1 does not current expose such a property.

There are workarounds available through snapshot dependencies (which are not quite deterministic, don't always run 1:1 for an upstream dependency, and are overly complex for this type of notification) and through the REST API plugin, but wow, wouldn't life just be easier if a build step could simply ask the question "Has the current build failed or not?"

I would just love it if I could write a simple Command Line build step, with Execute="Even if previous steps failed", that says:

if "%build.status%" == "SUCCESS" then perform the success action

if "%build.status%" == "FAILURE" then perform the failure action

if "%build.status%" == "STOPPED" then perform the stopped action

Any suggestions?

2 comments
Comment actions Permalink

Hi,

Please watch/vote for the related feature request: TW-17975 and try the suggested workaround.

0

Please sign in to leave a comment.