user3710806
user3710806

Reputation: 183

Jenkins Workflow Build Information

How do you access current, and related, build information from within a Jenkins workflow groovy script?

I can see things like currentBuild.result and currentBuild.previousBuild being documented, but I can't see how I can access, for example:

Thanks for any pointers.

Upvotes: 16

Views: 24275

Answers (1)

John Stadt
John Stadt

Reputation: 510

currentBuild.rawBuild will give you the non cached hudson.model.Run object, see hudson.model.Run

from there, to access i.e. the build log:

def buildLog = currentBuild.rawBuild.log

currentBuild.rawBuild is also of type hudson.model.AbstractBuild which can give you other details like changeset, actions

Upvotes: 27

Related Questions