Jenkins-Publish HTML reports

创建job:testreport

在job中添加:

在Jenkins服务器上:

创建目录:

.jenkins/jobs/{job名称}/workspace/htmlreports    注:此处job名称为testreport

该目录下创建文件:

report.html

文件内容:

 1 <html>
 2 <head>
 3 <meta charset="UTF-8">
 4 <h1>testreport</h1>
 5 </head>
 6 
 7 
 8 <body leftmargin="8" marginwidth="0" topmargin="8" marginheight="4"
 9     offset="0">
10     <table width="95%" cellpadding="0" cellspacing="0"
11         style="font-size: 11pt; font-family: Tahoma, Arial, Helvetica, sans-serif">
12 
13 <table border=0 cellspacing=1 cellpadding=3>
14   <tr>
15     <th><b><font color="#0B610B">Test</font></b></th>
16     <th><b><font color="#0B610B">Test Log</font></b></th>
17   </tr>
18   <tr>
19     <td>testreport</td>
20     <td align="center"><a href="test.log">test.log</a></td>
21   </tr>
22 </table>
23 
24 </body>
25 </html>

构建后:

点击显示内容:

上面的 Back to testreport 链接可返回job。

原文地址:https://www.cnblogs.com/workingdiary/p/6904302.html