<% import hudson.Util import hudson.Functions import hudson.model.Result; import hudson.matrix.MatrixBuild import hudson.matrix.MatrixRun import hudson.matrix.MatrixConfiguration import hudson.matrix.MatrixProject import hudson.matrix.Combination if (build.result == Result.SUCCESS) { result_img = "static/e59dfe28/images/32x32/blue.gif" } else if (build.result == Result.FAILURE) { result_img = "static/e59dfe28/images/32x32/red.gif" } else { result_img = "static/e59dfe28/images/32x32/yellow.gif" } if (build.builtOnStr == '') { built_on = 'master' } else { built_on = build.builtOnStr } def healthIconSize = "16x16" def healthReports = project.buildHealthReports Integer total_builds = 0 Integer total_failed = 0 Map toolchain_status = new HashMap(); Map toolchain_total_builds = new HashMap(); Map toolchain_total_failed = new HashMap(); Map architecture_status = new HashMap(); Map architecture_total_builds = new HashMap(); Map architecture_total_failed = new HashMap(); def matrix_build = build def runs = matrix_build.getExactRuns() hudson.matrix.MatrixProject matrix_project = project def matrix_axis = matrix_project.getAxes() def toolchain_axis = matrix_axis.find('AXIS1') def architecture_axis = matrix_axis.find('AXIS2') String toolchain String architecture Boolean something_failed = false // We want to initial all status maps to SUCCESS // We use runs to get actual matrix values because matrix_axis keeps a record of all // matrix/values. So, if you remove things they can still show up there. for (hudson.matrix.MatrixRun run : runs) { run_configuration = run.getParent() configuration_combination = run_configuration.getCombination() toolchain = configuration_combination.get(toolchain_axis) architecture = configuration_combination.get(architecture_axis) toolchain_status.put(toolchain,Result.SUCCESS) toolchain_total_builds.put(toolchain,0) toolchain_total_failed.put(toolchain,0) total_builds = total_builds + 1 architecture_status.put(architecture,Result.SUCCESS) architecture_total_builds.put(architecture,0) architecture_total_failed.put(architecture,0) } // OK, now run thru runs and set anything that FAILED. for (hudson.matrix.MatrixRun run : runs) { run_configuration = run.getParent() configuration_combination = run_configuration.getCombination() toolchain = configuration_combination.get(toolchain_axis) architecture = configuration_combination.get(architecture_axis) cnt = toolchain_total_builds.get(toolchain) cnt = cnt + 1 toolchain_total_builds.put(toolchain,cnt) cnt = architecture_total_builds.get(architecture) cnt = cnt + 1 architecture_total_builds.put(architecture,cnt) if (run.getResult() != Result.SUCCESS) { total_failed = total_failed + 1 toolchain_status.put(toolchain,Result.FAILURE) architecture_status.put(architecture,Result.FAILURE) something_failed = true cnt = toolchain_total_failed.get(toolchain) cnt = cnt + 1 toolchain_total_failed.put(toolchain,cnt) cnt = architecture_total_failed.get(architecture) cnt = cnt + 1 architecture_total_failed.put(architecture,cnt) } } %>
<% if (build.description != null) { %> <% } %> <% if (total_failed != 0) { %> <% } %>
BUILD ${build.result}
Build URL ${rooturl}${build.url}
Project: ${project.name}
Date of build: ${it.timestampString}
Build duration: ${build.durationString}
Build cause: <% for (hudson.model.Cause cause : build.causes) { %> ${cause.shortDescription} <% } %>
Build description: ${build.description}
Built on: ${built_on}
Total Builds: ${total_builds}
FAILURES: ${total_failed} out of ${total_builds} builds FAILED!
<% if (healthReports != null) { %>

Health Report

<% for (hudson.model.HealthReport healthReport : healthReports) { __url = healthReport.getIconUrl(healthIconSize) %> <% } %>
W Description Score
${healthReport.description} ${healthReport.score}

<% } %>
<% if (build.changeSet != null) { boolean hadChanges = false hudson.scm.ChangeLogSet cs = build.getChangeSet() %>

Changes

<% for (hudson.scm.ChangeLogSet.Entry entry : cs) { hadChanges = true %>

${entry.msgAnnotated}

by ${entry.author}

<% for (hudson.scm.ChangeLogSet.AffectedFile p : entry.affectedFiles) { %> <% } %>
${p.editType.name} ${p.path}
<% } if (hadChanges == false) { %>

No Changes

<% } } %>

Architecture Summary

<% for (String __val : architecture_status.keySet()) { Integer _total_cnt = architecture_total_builds.get(__val) Integer _failed_cnt = architecture_total_failed.get(__val) hudson.model.Result __result = architecture_status.get(__val) if (__result == Result.SUCCESS) { %> <% } else { %> <% } } %>
${__val} - OK
${__val} - FAILED. ${_failed_cnt} out of ${_total_cnt} failed to build!

Toolchain Summary

<% for (String __val : toolchain_status.keySet()) { hudson.model.Result __result = toolchain_status.get(__val) Integer _total_cnt = toolchain_total_builds.get(__val) Integer _failed_cnt = toolchain_total_failed.get(__val) if (__result == Result.SUCCESS) { %> <% } else { %> <% } } %>
${__val} - OK
${__val} - FAILED. ${_failed_cnt} out of ${_total_cnt} failed to build!
<% if (something_failed == true) { %>

Information

A change you committed to a source repository MAY be responsible for breaking a build.
Review the data below or follow the link below to review the output of the build.
If your change was responsible for the build failure, fix ASAP.
If your change is not responsible, there is no need to respond to this email.
All developers with changes associated with this build failure will continue to be notified until the build succeeds.
All developers that are notified of a build failure will be informed by email when the build is once again successful.
Instructions to reproduce the build failure will follow.
<% for (hudson.matrix.MatrixRun run : runs) { if (run.getResult() != Result.SUCCESS) { String toolchain_val run_configuration = run.getParent() url = run.getUrl() configuration_combination = run_configuration.getCombination() toolchain = configuration_combination.get(toolchain_axis) architecture = configuration_combination.get(architecture_axis) toolchain_val = toolchain %>

${toolchain_val} - ${architecture} Build Details

Build Output: ${rooturl}${url}/console
Reproduce: ARCH=${architecture} XENV=${toolchain_val} make
<% } } } %>