在 TeamCity 中创建变更日志工件
是否有一种简单的方法可以让 TeamCity 包含文本或 html 更改日志作为其输出工件之一?
也许我需要沿着让 msbuild 或其他进程创建更改日志的路线,但由于 TeamCity 为每个构建生成一个更改日志,我想知道是否已经有一种简单的方法可以将其作为工件访问并将其包含在工件路径指令,以便它可以成为发布包的一部分。
Is there a simple way to have TeamCity include a text or html change-log as one of its output artifacts?
Perhaps I need to go down the route of having msbuild or some other process create the change log but as TeamCity generates one for every build, I'm wondering if there is already a simple way to access it as an artifact and include it in the artifact paths directives so that it can be part of a release package.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的,更改日志可以作为文件访问,该文件的路径位于 TeamCity 构建参数中:
因此您可以执行以下操作:
Yes, the change-log is accessible as a file, path to this file is in the TeamCity build parameter:
So you could do this:
您可以通过 TeamCity 的 REST API 生成更改日志。可以在此处<找到相关的 PowerShell 脚本/a>
对于 TeamCity v10.x 和上图:
对于 Teamcity v10.x 之前的版本:
You can generate a change log via the REST API of TeamCity. A PowerShell script for this can be found here
For TeamCity v10.x & above:
For versions before Teamcity v10.x:
上面的脚本可以工作,但是它只包含当前构建的签入注释。
因此,我稍微修改了这个脚本,使其包含自上次成功构建以来的所有更改。
在 Teamcity 中,获取最后一个成功的构建编号很棘手,因此我只获取最后 10 个构建,然后迭代这些更改,直到找到最后一个成功的构建。
The above script works, however it only includes check in comments of the current build.
So I've slightly amended this script so that it does include all changes since the last successful build.
In Teamcity it's tricky to get the last successful build number so that's why I just get the last 10 builds and then iterate over these changes until I've found the last successful build.
您可能应该使用服务消息
Possible you should use Service Messages