Igo*_*gor 41 git email hudson changelog jenkins
有没有办法将Jenkins生成的更改日志导入电子邮件主题(通过默认电子邮件或email-ext插件)?
我是Jenkins配置的新手,所以我很抱歉这是一个简单的问题,但我无法在email-ext文档中找到任何内容.
Ste*_*HHH 70
我配置了我的Email-ext插件以使用CHANGES Token(官方文档):
Changes:
${CHANGES, showPaths=true, format="%a: %r %p \n--\"%m\"", pathFormat="\n\t- %p"}
Run Code Online (Sandbox Code Playgroud)
这会在我的构建通知中打印以下内容:
Changes:
Username: 123
- Project/Filename1.m
- Project/Filename2.m
-- "My log message"
Run Code Online (Sandbox Code Playgroud)
对于HTML消息,我在div中放置了相同的代码并添加了格式:
<div style="padding-left: 30px; padding-bottom: 15px;">
${CHANGES, showPaths=true, format="<div><b>%a</b>: %r %p </div><div style=\"padding-left:30px;\"> — “<em>%m</em>”</div>", pathFormat="</div><div style=\"padding-left:30px;\">%p"}
</div>
Run Code Online (Sandbox Code Playgroud)
以下是Jenkins现在发送的电子邮件中的示例截图(此特定提交来自Subversion,但它与Git和其他版本控制系统完全相同):

Yan*_*kov 17
从原始文档: 要查看所有可用电子邮件令牌及其显示内容的列表,您可以单击"?" (问号)与项目配置屏幕上email-ext部分底部的内容令牌参考相关联.
结果如下:
${CHANGES}
Displays the changes since the last build.
showDependencies
If true, changes to projects this build depends on are shown. Defaults to false
showPaths
If true, the paths, modifued by a commit are shown. Defaults to false
format
For each commit listed, a string containing %X, where %x is one of:
%a
author
%d
date
%m
message
%p
path
%r
revision
Not all revision systems support %d and %r. If specified showPaths argument is ignored. Defaults to "[%a] %m\\n"
pathFormat
A string containing %p to indicate how to print paths. Defaults to "\\t%p\\n"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
36846 次 |
| 最近记录: |