Jenkins Workflow Build Information

前端 未结 1 1154
小蘑菇
小蘑菇 2020-12-31 06:28

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.pr

相关标签:
1条回答
  • 2020-12-31 07:12

    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

    0 讨论(0)
提交回复
热议问题