Jenkins - 获取上次完成的构建状态 [英] Jenkins - Get last completed build status

查看:126
本文介绍了Jenkins - 获取上次完成的构建状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我可以调用 localhost/job/RSpec/lastBuild/api/json 来获取最新的 Jenkins 构建的状态.然而,由于我们的构建运行时间很长(几个小时),与此时正在运行的运行相比,我对最后一个完成构建状态更感兴趣.

I know I can call localhost/job/RSpec/lastBuild/api/json to get the status of the lastest Jenkins build. However, since our build runs very long (a couple hours), I'm really more interested in the last complete build status than the run that is running at this exact moment.

上次完全运行的构建是否有 api 端点?或者我应该拉取完整的构建列表并从那里选择倒数第二个?

Is there an api end point for the last fully run build? Or should I instead pull the full list of builds and select the next-to-last one from there?

推荐答案

试试 http://$host/job/$jobname/lastSuccessfulBuild/api/json

Try http://$host/job/$jobname/lastSuccessfulBuild/api/json

Jenkins(和 Hudson)公开多个不同的构建,例如 lastBuild、lastStableBuild、lastSuccessfulBuild,lastFailedBuild、lastUnstableBuild、lastUnsuccessfulBuild、lastCompletedBuild.

Jenkins (and Hudson) expose multiple different builds, such as lastBuild, lastStableBuild, lastSuccessfulBuild, lastFailedBuild, lastUnstableBuild, lastUnsuccessfulBuild, lastCompletedBuild.

这篇关于Jenkins - 获取上次完成的构建状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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