<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
<style type="text/css"> | |
/*base css*/ | |
body | |
{ | |
margin: 0px; | |
padding: 15px; | |
} | |
body, td, th | |
{ | |
font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Tahoma, sans-serif; | |
font-size: 10pt; | |
} | |
th | |
{ | |
text-align: left; | |
} | |
h1 | |
{ | |
margin-top: 0px; | |
} | |
a | |
{ | |
color:#4a72af | |
} | |
/*div styles*/ | |
.status{background-color:<%= | |
build.result.toString() == "SUCCESS" ? 'green' : 'red' %>;font-size:28px;font-weight:bold;color:white;width:720px;height:52px;margin-bottom:18px;text-align:center;vertical-align:middle;border-collapse:collapse;background-repeat:no-repeat} | |
.status .info{color:white!important;text-shadow:0 -1px 0 rgba(0,0,0,0.3);font-size:32px;line-height:36px;padding:8px 0} | |
</style> | |
<body> | |
<div class="content round_border"> | |
<div class="status"> | |
<p class="info">The build <%= build.result.toString().toLowerCase() %></p> | |
</div> | |
<!-- status --> | |
<table> | |
<tbody> | |
<tr> | |
<th>Project:</th> | |
<td>${project.name}</td> | |
</tr> | |
<tr> | |
<th>Build ${build.displayName}:</th> | |
<td><a | |
href="${rooturl}${build.url}">${rooturl}${build.url}</a></td> | |
</tr> | |
<tr> | |
<th>Date of build:</th> | |
<td>${it.timestampString}</td> | |
</tr> | |
<tr> | |
<th>Build duration:</th> | |
<td>${build.durationString}</td> | |
</tr> | |
<tr> | |
<td colspan="2"> </td> | |
</tr> | |
</tbody> | |
</table> | |
<!-- main --> | |
<% def artifacts = build.artifacts | |
if(artifacts != null && artifacts.size() > 0) { %> | |
<b>Build Artifacts:</b> | |
<ul> | |
<% artifacts.each() { f -> %> | |
<li><a href="${rooturl}${build.url}artifact/${f}">${f}</a></li> | |
<% } %> | |
</ul> | |
<% } %> | |
<!-- artifacts --> | |
<% | |
lastAllureReportBuildAction = build.getAction(ru.yandex.qatools.allure.jenkins.AllureReportBuildAction.class) | |
lastAllureBuildAction = build.getAction(ru.yandex.qatools.allure.jenkins.AllureBuildAction.class) | |
if (lastAllureReportBuildAction) { | |
allureResultsUrl = "${rooturl}${build.url}allure" | |
allureLastBuildSuccessRate = String.format("%.2f", lastAllureReportBuildAction.getPassedCount() * 100f / lastAllureReportBuildAction.getTotalCount()) | |
} | |
%> | |
<% if (lastAllureReportBuildAction) { %> | |
<h2>Allure Results</h2> | |
<table> | |
<tbody> | |
<tr> | |
<th>Total Allure tests run:</th> | |
<td><a href="${allureResultsUrl}">${lastAllureReportBuildAction.getTotalCount()}</a></td> | |
</tr> | |
<tr> | |
<th>Failed:</th> | |
<td>${lastAllureReportBuildAction.getFailedCount()} </td> | |
</tr> | |
<tr> | |
<th>Passed:</th> | |
<td>${lastAllureReportBuildAction.getPassedCount()} </td> | |
</tr> | |
<tr> | |
<th>Skipped:</th> | |
<td>${lastAllureReportBuildAction.getSkipCount()} </td> | |
</tr> | |
<tr> | |
<th>Broken:</th> | |
<td>${lastAllureReportBuildAction.getBrokenCount()} </td> | |
</tr> | |
<tr> | |
<th>Success rate: </th> | |
<td>${allureLastBuildSuccessRate}% </td> | |
</tr> | |
</tbody> | |
</table> | |
<img lazymap="${allureResultsUrl}/graphMap" src="${allureResultsUrl}/graph" alt="Allure results trend"/> | |
<% } %> | |
<!-- content --> | |
<!-- bottom message --> | |
</body> |
node { | |
stage('Test') { | |
//... test execution steps | |
} | |
stage('Build report'){ | |
allure includeProperties: false, jdk: '', results: [[path: 'target/allure-results']] | |
} | |
stage('Send Summary'){ | |
emailext body: '''${SCRIPT, template="allure-report.groovy"}''', | |
subject: "[Jenkins] Test Execution Summary", | |
to: "all@example.com" | |
} | |
} |
Yeah mine works fine. Did you try copying mine exactly first?
I am not sure where to put the Jenkins file. How does that differ from putting that script in say a pipeline?
If I could just find the JENKINS_HOME/email-templates this would be easier but I cannot find it
If you don't have the email-templates folder you need to create it yourself
@letsrokk now i have something like this
after attaching that as a default content :/
Did you ever fix this?
Hi,
Even i am getting similar kind of issue , expressions are not getting evaluated , can some one help
Using the following code,
lazymap="${allureResultsUrl}/graphMap" src="${allureResultsUrl}/graph" alt="Allure results trend"
This picture can be displayed in the email 。
I want to show more other pictures in Allure report, like other pictures in ${allureResultsUrl}/# , Does it have some function urls that can be called ?
Can I call these functions through python script in Jenkins' workspace ?
build.getAction(ru.yandex.qatools.allure.jenkins.AllureReportBuildAction.class)
build.getAction(ru.yandex.qatools.allure.jenkins.AllureBuildAction.class)
I followed step1 to step5 using Config File Provider plugin. For my project, we dont have jenkins file just job. How i can trigger this to generate summary report using jenkin job. Please let us know if any one have any suggestion to achieve this with out using jenkins file.
I followed step1 to step5 using Config File Provider plugin. For my project, we dont have jenkins file just job. How i can trigger this to generate summary report using jenkin job. Please let us know if any one have any suggestion to achieve this with out using jenkins file.
I haven't used jobs in a while but is there an option for Post Build Options? I think that is where you trigger it from
Yes we have post build option..I am not aware, how to trigger the execution of groovy email template file configured in config file provider plugin. If any one have any suggestions, please let us know..
I am not sure where to put the Jenkins file. How does that differ from putting that script in say a pipeline?
If I could just find the JENKINS_HOME/email-templates this would be easier but I cannot find it