This Question is Not Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
0 Replies Last post: Jan 19, 2013 3:18 AM by Doug Schmidt  
Doug Schmidt Newbie 1 posts since
Jan 16, 2013
Currently Being Moderated

Jan 19, 2013 3:18 AM

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?

More Like This

  • Retrieving data ...