Print build log data in build error details and email notification
We built a command line script which works just fine using the exit code to pass or fail a build. However, we are looking into sending the console output to the build details and into the email notification.
Right now, we get:
Process exited with code 1 (Step: Program (Command Line))
[13:00:25]
Process exited with code 1
« Hide details
We are now looking for the environment variable TEAMCITY_VERSION to print the error in "TeamCity format":
Console.Out.WriteLine(
"##teamcity[message text='Program failed.' errorDetails='" +
ex.Message + "' status='ERROR']");
"##teamcity[message text='Program failed.' errorDetails='" +
ex.Message + "' status='ERROR']");
Is it possible to include that message text and errorDetails into the build details and into the email?
Thanks!
Please sign in to leave a comment.
Hi Ismael,
Pushing the text to the build status line can be easily accomplished: https://confluence.jetbrains.com/display/TCD18/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingBuildStatus
Adding it to the emails is going to be much more complicated. The notification emails aren't sent by the build, but after the build, it's the notification which pulls information from the build. There are some customization options that you can find in our documentation here: https://confluence.jetbrains.com/display/TCD18//Customizing+Notifications