Vel*_*esh 2 email groovy jenkins jenkins-plugins
扩展电子邮件通知的"默认内容"设置如下,默认内容类型为"HTML(文本/ html)":
<html>
<body>
<%
if(build.testResultAction) {
def testResult = build.testResultAction
def testCount = String.format("%.2f",(testResult.totalCount))
def testPassed = String.format("%.2f",())
def testFailed = String.format("%.2f",(testResult.result.failCount))
def testSkipped = String.format("%.2f",())
def buildDuration = String.format("%.2f",(testResult.result.duration ))
}
%>
Hi All,<br><br>
The execution of the Automation suite has been completed and the results are as below.<br><br>
<b><u>Configuration :</u></b><br>
Project Name : $JOB_NAME<br>
Test Server URL : $Test_Server_URL<br>
Group Name : $Group_Name<br><br>
<b><u>Execution Results :</u></b><br>
Status : <font color="blue">$BUILD_STATUS</font><br>
Tests run : $testCount<br>
Failures : $testFailed<br>
Errors : 0<br>
Skipped : 0<br>
Total time : $buildDuration<br>
Finished at: Tue May 06 17:12:19 IST 2014<br>
Build URL : $BUILD_URL<br><br>
The HTML version of the automation results and the log file is attached with this e-mail for your reference.<br><br>
Regards,<br>
Jenkins CI Tool
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
但是报告电子邮件在其正文中具有groovy代码本身而不是预期值.
查看emai-ext插件的wiki页面,了解如何使用脚本内容,其中描述的步骤如下:
JENKINS_HOME/email-templates/${SCRIPT, template="name-of-template"}| 归档时间: |
|
| 查看次数: |
8993 次 |
| 最近记录: |