Failed Build Message in email

Hello,

We use TeamCity Services messages to fail a build, like so:

##teamcity[message text='Jus a sample for this post' errorDetails='Sample Error Details' status='Error']


Now, this will add the error (when it occurs) to the overview page of a completed build.  However, the build errors are not included in the failure email.  


We found this code from another thread and attempted to modify build_failed.ftl:

<#list build.buildLog.messages[1..] as message><#-- skipping the first message (it is a root node)-->
   <#if message.status == "ERROR" || message.status == "FAILURE" >
   ${message.text}
   </#if>
</#list>


However, that didn't add the Build Errors to the failure email.

Any idea what we're doing wrong?

Thanks!
3 comments
Comment actions Permalink

Hello,

What TeamCity version are you using?
Since TeamCity 7.1 the correct way to fail a build is to report a build problem (as described here).
The build problem description will be added to the build status text and appear in the failure notification e-mail.

0
Comment actions Permalink

Thanks Victory.  I'm using TeamCity 8.06.   I see that the build status will be in the email, but I'd like the Build Error log in the email as well, for example. this is on my Overview page:

Build errors

[17:28:22]Step 1/1: Build With Script (Command Line) (20s)

[17:28:42][Step 1/1] ndk-build failed [armeabi-v7a] Compile++ arm  : test-app <= test-app.cpp [armeabi-v7a] Compile++ arm  : test-app <= main.cpp jni/main.cpp:25:18: error: missing terminating > character make: *** [obj/local/armeabi-v7a/objs/test-app/main.o] Error 1

[17:28:42][Step 1/1] Step Build With Script (Command Line) failed

I'd like that in my email.

0
Comment actions Permalink

Hello,

To have the list of all build log error messages in the notifiaction email you need to add the mentioned above FTL fragment to the following files under /webapps/ROOT/WEB-INF/plugins/email/server/email-notificator.jar/email_templates:

build_failed.ftl
build_failed_to_start.ftl
buid_failing.ftl


Please notice that using "build.buildLog.messages" may seriously affect the performance if the build has many messages in the build log.

0

Please sign in to leave a comment.