如何让 Hudson 自上次部署以来创建变更日志
我希望我们的 Hudson 部署作业能够输出自上次部署以来所有 Subversion 更改的更改日志。关于如何做到这一点有什么想法吗?
I would like our Hudson deploy job to output a changelog of all Subversion changes since last deploy. Any ideas to how that is done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实证明,Hudson 自动生成自上次构建以来的更改列表。
由于我们在 Hudson 中设置了部署,因此每个部署都有一个提交列表及其更改。 Hudson email-ext 插件 使它们可以作为
$CHANGES
,这样它就可以发送一封电子邮件正文中包含$CHANGES
的电子邮件。当然,这种方法有局限性:这里仅显示自上次部署以来的更改。因此,如果您手动停止部署,或者部署构建中断,则下一个更改日志仅包含此后的更改。自从上次成功部署以来就没有了。
另请参阅 Stackoverflow 问题中的相关讨论 通过 Hudson 发送 Subversion 更改日志信息
It turns out that Hudson automatically generates a list of changes since last build.
And since we set up deployment in Hudson, each deployment has a list of commits along with their changes. The Hudson email-ext plugin makes them available as
$CHANGES
, so that it for instance can send an email with$CHANGES
in the email body.Of course, there are limits to this approach: Only changes since last deploy are here. So if you manually stop deployment, or the deployment build breaks, then the next changelog only contains changes since that. And not since last successful deployment.
Also see a related discussion in the Stackoverflow question Sending Subversion Change Log Info Via Hudson
在运行 shell 脚本的 hudson 作业中添加构建步骤:
生成自上次提交以来的更改的更改列表。
您还可以按日期/日期范围执行 log -r。
您能否确定您的最后一次部署(我假设您可能不会在每个构建中都进行部署。)有关您的流程的更多信息将会有所帮助。
如果您使用标准化模式标记您的部署,那么创建一个允许您获得正确的 SVN 修订版的计数器将相当简单。
Add a build step in your hudson job that runs a shell script:
To generate a change list of the changes since the last commit.
You can also do a log -r by date/date-range.
Can you determine your last deploy (I assume you may not deploy with every build.) Some more information about your process will help.
If you tag your deployments with a normalised pattern it would be fairly simple to create a counter that would allow you to get the right SVN revision.