Reputation: 138
I'm writing a Groovy script for a build that needs to send and email with the build log in the message body. I was wondering if there was an easy way to read the current build output without having to pipe every step to a temporary file. This needs to happen while the build is still running.
Upvotes: 2
Views: 4632
Reputation: 47
I am using this script to trigger email:
if (build.getLog().contains("FAILED"))
{
cancel = true;
}
else
{
cancel = false;
}
You can find the available methods here.
Upvotes: 2
Reputation: 7385
I think you can get it also during build via the REST-API:
http(s)://<server-URL>/job/<job-Name>/lastBuild/consoleText
Upvotes: 2