Search code examples
jenkinsjenkins-pluginsjenkins-workflow

Get Build Log from Jenkins Workflow script at runtime?


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.


Solution

  • I think you can get it also during build via the REST-API:

    http(s)://<server-URL>/job/<job-Name>/lastBuild/consoleText