如何生成变更日志:自上次 Hudson 构建以来的 git log? [英] How to generate changelog: git log since last Hudson build?

查看:20
本文介绍了如何生成变更日志:自上次 Hudson 构建以来的 git log?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Phing 在 Hudson 执行后期构建任务.

I'm using Phing to do post build tasks in Hudson.

我想生成包含自上次成功构建 Hudson 以来的所有提交的更改日志.但是看起来 Hudson 和 Hudson 的 Git 插件都没有提供 %last_build_time% 变量.

I want to generate changelog containing all commits since last successful Hudson build. But looks like neither Hudson nor Git plugin for Hudson does not provide %last_build_time% variable.

这将是令人满意的解决方案,(但如何获得时间?):

This would be satisfying solution, (but how to get the time?):

git log --pretty="%s" --since="%last_build_time%"

我目前看到的唯一方法是从作业 xml 文件中提取它,但我不知道是否可以使用 Phing.

The only way I see for now is extracting it from the job xml file, but I do not know if it is possible with Phing.

您如何生成更改日志?

推荐答案

我已经使用 bash 提取了上次成功构建的日期:

I have extracted last successful build date using bash:

git log --pretty="%s" --since="`date -r ./../lastSuccessful/build.xml "+%F %T"`"

(在 xml 文件中,我必须将 " 替换为 &quote; 实体).

(In xml file I had to replace " with &quote; entity).

这篇关于如何生成变更日志:自上次 Hudson 构建以来的 git log?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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