Jenkins工作流构建信息 [英] Jenkins Workflow Build Information

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

问题描述



我可以看到诸如currentBuild.result和currentBuild.previousBuild之类的东西记录下来,但我看不到如何访问,例如:




  • 当前构建作业的URL。

  • 此工作流程触发的构建作业的URL

  • 特定失败构建作业的控制台输出等。

  • ul>

    感谢您的任何指示。

    解决方案

    currentBuild .rawBuild 会为您提供非缓存的 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屋!

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