Command Line Builder - Important Messages To Email Template?

Hello!

Alright, I've finally wrestled our command line builders into spitting out some useful messages on error.  Only problem thus far is that it doesn't seem to send them in our e-mail template.

I've used ##teamcity[message status='FAILURE'...] style messages to report compile errors, which get shown on the important messages, but they don't get e-mailed out.

Is there any other way to get this to show up in e-mails?

-e-

P.S.  It would be nice if I could simply specify a regex that lists something as a 'compile' error, and then it should just 'work' with the existing templates no?  Is that possible?  I'd much rather prefer that.

3 comments
Comment actions Permalink

Notifier messages are composed from templates, unfortunately there is no out of the box support for error messages pattern in the template. However you can write a plugin to TeamCity server which provides such pattern. For this you will need to register your pattern processor in the TemplateMessageBuilder. Some useful links:
- http://javadoc.jetbrains.net/teamcity/openapi/current/jetbrains/buildServer/notification/TemplateMessageBuilder.html
- http://www.jetbrains.net/confluence/display/TCD4/Extending+TeamCity

Example of the email template:
    <template id="build_failed_tpl">
      <subject>Build {PROJECT_NAME}::{BUILD_CONFIG_NAME} {BUILD_NUMBER} failed {SHORT_STATUS_DESCRIPTION}</subject>
      <body>Build {PROJECT_NAME}::{BUILD_CONFIG_NAME} {BUILD_NUMBER} failed {SHORT_STATUS_DESCRIPTION}
Agent: {AGENT_NAME}
Build results: {BUILD_RESULTS_LINK}

{COMPILATION_ERRORS}{FAILED_TESTS_ERRORS}{CHANGES}</body>
    </template>

{COMPILATION_ERRORS} is a pattern for compilation errors. Your messages however will not be treated by server as compilation errors and currently there is no way to report compilation errors with help of service messages. I submitted a feature request for this, feel free to vote/comment: http://jetbrains.net/tracker/issue2/TW-8108

We have plans to extend support for errors detecting, probably with help of regexps. However it may not be easy to provide such regexps for compilation errors. At least this is not easy task for javac.

0
Comment actions Permalink

>  feel free to vote/comment: http://jetbrains.net/tracker/issue2/TW-8108

This url does not exist?

0
Comment actions Permalink

Hi

Working link is http://youtrack.jetbrains.net/issue/TW-8108.
It has not implemented yet, buut in upcomming version 7.0 we'll allow to fail a build based on specific log messages:
http://blogs.jetbrains.com/teamcity/2011/10/05/fail-build-on-specific-log-message/

Michael

0

Please sign in to leave a comment.