--- /dev/null
+<html>
+
+<head>
+<title>GBS Build Report</title>
+<style>
+.failed { color: red }
+.succeeded { color: green }
+table {
+ border-collapse:collapse;
+ margin-bottom: 1em;
+}
+
+th { background-color: #F3F3F3 }
+td, th {
+ border: 1px solid grey;
+ padding: 3px
+}
+
+table.middle th { text-align: left }
+
+</style>
+
+</head>
+
+<body>
+
+
+<h1 align="center" >GBS Local Full Build Report</h1>
+
+<p><B>Profile:</B> <TMPL_VAR build_profile></p>
+<p><B>Arch:</B> <TMPL_VAR build_arch></p>
+
+<h3>Build Status Summary</h3>
+
+<table class = middle>
+ <tr>
+ <th>Total Packages</th>
+ <th>succeeded Packages</th>
+ <th>Export Error Packages</th>
+ <th>Expansion Error Packages</th>
+ <th>Build Error Packages</th>
+ </tr>
+ <tr>
+ <td><TMPL_VAR packages_total></td>
+ <td><TMPL_VAR packages_succeeded></td>
+ <td><TMPL_VAR packages_export_error></td>
+ <td><TMPL_VAR packages_expansion_error></td>
+ <td><TMPL_VAR packages_build_error></td>
+ </tr>
+</table>
+
+
+<tmpl_if name=have_export_errors>
+<h3>Export error details</h3>
+The following packages can't be exported correctly:
+ <table class = middle>
+ <thead>
+ <tr>
+ <th>Package name</th>
+ <th>Package path</th>
+ <th>Export error</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tmpl_loop export_details>
+ <tr>
+ <td><tmpl_var package_name></td>
+ <td><tmpl_var package_path></td>
+ <td><tmpl_var error_info></td>
+ </tr>
+ </tmpl_loop>
+ </tbody>
+ </table>
+</tmpl_if>
+
+
+<tmpl_if name=have_expansion_errors>
+<h3>Expansion error details</h3>
+The following packages have build dependencies issue:
+ <table class = middle>
+ <thead>
+ <tr>
+ <th>Package name</th>
+ <th>Package path</th>
+ <th>Expansion error</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tmpl_loop expansion_details>
+ <tr>
+ <td><tmpl_var package_name></td>
+ <td><tmpl_var package_path></td>
+ <td><tmpl_var error_info></td>
+ </tr>
+ </tmpl_loop>
+ </tbody>
+ </table>
+</tmpl_if>
+
+<h3>Build Statis Details</h3>
+<table class = middle>
+ <thead>
+ <tr>
+ <th>Package Name</th>
+ <th>Package Path</th>
+ <th>Build Status</th>
+ </tr>
+ </thead>
+ <tbody>
+ <TMPL_LOOP build_details>
+ <tr>
+ <td><TMPL_VAR package_name></td>
+ <td><TMPL_VAR package_path></td>
+ <TMPL_IF NAME="succeeded">
+ <td><a href=<TMPL_VAR log_path> class = succeeded> Succeeded </a> </td>
+ <TMPL_ELSE>
+ <td><a href=<TMPL_VAR log_path> class = failed> Failed </a> </td>
+ </TMPL_IF>
+ </tr>
+ </TMPL_LOOP>
+ </tbody>
+</table>
+</body>
+
+</html>
use warnings;
use File::Spec::Functions;
use JSON;
+use HTML::Template;
BEGIN {
my ($wd) = $0 =~ m-(.*)/- ;
}
+sub build_html_report
+{
+ my $template_file = "/usr/share/depanneur/build-report.tmpl";
+
+ if (! -e $template_file) {
+ warning("html template $template_file does not exist.");
+ return;
+ }
+
+ # generate html format report
+ my $tmpl = HTML::Template->new(filename => $template_file);
+ $tmpl->param(
+ build_profile => $build_status_json{"build_profile"},
+ build_arch => $build_status_json{"build_arch"},
+ );
+
+ $tmpl->param($build_status_json{"summary"});
+
+ if (@export_errors) {
+ $tmpl->param( have_export_errors => 1,
+ export_details => $build_status_json{"export_details"}
+ );
+ }
+
+ if (%expansion_errors) {
+ $tmpl->param( have_expansion_errors => 1,
+ expansion_details => $build_status_json{"expansion_details"}
+ );
+ }
+
+ $tmpl->param(
+ build_details => $build_status_json{"build_details"}
+ );
+
+ open(my $report_html, '>', "$localrepo/$dist/$arch/index.html");
+ $tmpl->output(print_to => $report_html);
+ close($report_html);
+}
+
+
sub build_json_report
{
info("generate html format report" );
$build_status_json{"expansion_details"} = \@expansion_details;
$build_status_json{"build_details"} = \@build_details;
+ build_html_report();
build_json_report();
error($msg);
}