Jenkinsfile构建日志 [英] Jenkinsfile build log

查看:427
本文介绍了Jenkinsfile构建日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何内置变量可以访问当前正在执行的内部版本的文本?

Is there any builtin variable that gives access to the text of the currently executing build?

我尝试使用类似currentBuild.logcurrentBuild.buildLog的方法,但是没有任何运气.

I tried using something like currentBuild.log, currentBuild.buildLog but without any luck.

推荐答案

实际上,可以使用currentBuild.rawBuild.log或更好的版本(不推荐使用)currentBuild.rawBuild.getLog(100)(对于最后100行),请参考:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆