詹金斯:如何保存变更日志以进行构建 [英] Jenkins: how to save changelog for build
问题描述
我在SVN下拥有Jenkins-CI和C ++项目. 如何保存成功构建到文本(或html)文件之间的更改日志? 詹金斯(Jenkins)是否有任何带有.../changes页面内容的变量/临时文件?
I have Jenkins-CI and C++ project under SVN. How to save changelog between successfull builds into text (or html) file ? Does Jenkins have any variable/temp file with content of .../changes page?
推荐答案
以下是XPath代码,可以通过Jenkins API获得给定构建ID的变更集:
Here is XPath code that can get you the changeset for a given build id via Jenkins API:
http://[jenkins_host]/api/xml?depth=2&xpath=//build/id[text()='${BUILD_ID}']/../changeSet
(输入实际的内部版本ID而不是$ {BUILD_ID}).收集变更集的脚本(例如,使用 Python Jenkins 的Pyhon脚本)可以使用此方法导致每次构建结束并将其存储在临时位置.构建成功后,脚本可以收集自上次构建以来存储的所有结果并进行处理.
(Put actual build id instead of ${BUILD_ID}). This can be used by a script (say, a Pyhon script utilizing Python Jenkins) that collects changeset results in the end of every build and stores them in a temp locations. After a successful build the script can collect all results stored since the previous build and process them.
这篇关于詹金斯:如何保存变更日志以进行构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!