Using value set in build script in a Failure Conditions Failure message

 

I have configured a build script to echo the following before it exits:

echo "##teamcity[setParameter name='env.teamcity_build_failure_message' value='${FAILED_COUNT} of ${COUNT} images failed to build']"

I have then configured a failure condition with the failure message set to the following:

%env.teamcity_build_failure_message%

When I ‘Test on finish build’ I can see the following:

When I save the Failure Condition I see that the Parameters menu item has an error:

If I try to start a build I get an error saying “There are no idle compatible agents which can run this build” and can see the following:

If I then set a parameter value this build will run but will just show whatever value I set as the build status.

Can this be made to work? What am I missing?

0
2 comments

Hi,

Thank you for reporting this. I have submitted a bug: TW-85698 on your behalf. Please follow it for updates.

0
\>If I then set a parameter value this build will run but will just show whatever value I set as the build status.


What do you mean by that? If I see correctly, the build fails on this failure condition, but there is a confusing message in the log, is it that problem here?
0

Please sign in to leave a comment.