如何获得“更改"? (提交消息)触发了Jenkins构建? [英] How do I get the "changes" (commit message) that triggered a Jenkins build?
本文介绍了如何获得“更改"? (提交消息)触发了Jenkins构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以去
http://myjenkins:8080/job/Project/42/changes
并查看触发特定Jenkins构建的提交消息.
and see the commit message that triggered a particular Jenkins build.
但是,我想通过REST API或其他方式来获取它.我的搜索没有任何运气.有没有简单的方法可以做到这一点?
However, I want to grab this via REST API or something. I'm not having any luck in search. Is there an easy way to do this?
推荐答案
下面是一个如何从Jenkins构建中获取评论,受影响的文件和提交ID的示例:
Here's an example of how to get the comment, affected files and commit ID from a Jenkins build:
curl http://jenkins/job/JOB_NAME/BUILD_NUMBER/api/json?pretty=true&tree=changeSet[items[comment,affectedPaths,commitId]]
这篇关于如何获得“更改"? (提交消息)触发了Jenkins构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文