Jenkinsfile 构建日志 [英] Jenkinsfile build log
本文介绍了Jenkinsfile 构建日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有任何内置变量可以访问当前正在执行的构建的文本?
Is there any builtin variable that gives access to the text of the currently executing build?
我尝试使用 currentBuild.log
、currentBuild.buildLog
之类的东西,但没有任何运气.
I tried using something like currentBuild.log
, currentBuild.buildLog
but without any luck.
推荐答案
实际上可以使用 currentBuild.rawBuild.log
或更好(不推荐使用)currentBuild.rawBuild.getLog(100)
(最后 100 行),参考:http://javadoc.jenkins-ci.org/hudson/model/Run.html#getLog-int-
Actually it is possible using currentBuild.rawBuild.log
or better (not deprecated) currentBuild.rawBuild.getLog(100)
(for the last 100 lines), reference: http://javadoc.jenkins-ci.org/hudson/model/Run.html#getLog-int-
这篇关于Jenkinsfile 构建日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文