Jenkins工作流构建信息 [英] Jenkins Workflow Build Information
问题描述
我可以看到诸如currentBuild.result和currentBuild.previousBuild之类的东西记录下来,但我看不到如何访问,例如:
- 当前构建作业的URL。
- 此工作流程触发的构建作业的URL
- 特定失败构建作业的控制台输出等。
ul>
感谢您的任何指示。
hudson.model.Run
对象,请参阅 hudson.model.Run
从那里访问即构建日志:
def buildLog = currentBuild.rawBuild.log
currentBuild.rawBuild
也是 hudson.model.AbstractBuild 可以给你其他细节,比如 changeset
, actions
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:
- The URL of the current build job.
- The URL of build jobs that this workflow triggered.
- The console output of a particular failed build job, etc.
Thanks for any pointers.
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
这篇关于Jenkins工作流构建信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!