如何获得Jenkins的“控制台输出"远程触发构建后? [英] How to get Jenkins "Console Output" after triggering build remotely?

查看:1516
本文介绍了如何获得Jenkins的“控制台输出"远程触发构建后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Perl脚本使用LWP模块触发Jenkins中的构建.可以,但是执行完作业后,我想解析控制台输出.

I am using a Perl script to trigger a build in Jenkins using LWP modules. This works but after executing the job, I would like to parse the console output.

有办法得到这个吗?

推荐答案

登录Jenkins,查看网页底部右侧附近的位置,然后单击REST API链接.这将为您提供有关Jenkins的信息 RESTful API ,这是一种了解Jenkins信息的好方法构造URL.

Log into Jenkins and take a look at the bottom of the webpage near the right hand side and click on the REST API link. This will give you information about the Jenkins RESTful API which is a great way to pull information off of Jenkins once you understand how to construct the URL.

而且,这是获取控制台文本的方法:

And, here's how you get the console text:

$ curl "${JENKINS_URL}/job/${JOB_NAME}/lastBuild/consoleText"

您可以使用Perl的各种 LWP 模块与Jenkins对话.

You can use Perl's various LWP modules to talk to Jenkins.

这篇关于如何获得Jenkins的“控制台输出"远程触发构建后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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