templatize show_log
[buildfarm-server.git] / templates / log.tt
1 [% PERL %]
2         use POSIX qw(ceil);
3         my $lrfactor = 6;
4         $stash->set(lrfactor => $lrfactor);
5         my $rows = $stash->get('log_file_names'); 
6         my $logrows = ceil(scalar(@$rows)/$lrfactor);
7         my $logcells = $lrfactor * $logrows;
8         $stash->set( logcells => $logcells);
9         $stash->set( logrows => $logrows ); 
10 [% END -%]
11 [%
12         cvsurl = 'http://anoncvs.postgresql.org/cvsweb.cgi';
13         giturl = scmurl || 'http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=';
14 -%]
15 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
16         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
17 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
18 <head>
19         <meta http-equiv="content-type" content="text/html; charset=utf-8" />
20     <title>PostgreSQL BuildFarm | [% IF stage != 'OK' %]Log for system "[% system %]" failure on snapshot taken [% urldt ; ELSE %]Configuration summary for system "[% system %]" snapshot taken [% urldt ; END %]</title>
21     <link rel="icon" type="image/png" href="/elephant-icon.png" />
22     <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
23 </head>
24 <body>
25 <div id="wrapper">
26 <div id="banner">
27 <a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
28 <div id="nav">
29 <ul>
30     <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
31     <li id="status"><a href="/cgi-bin/show_status.pl" title="Status Page">Status</a></li>
32     <li id="members"><a href="/cgi-bin/show_members.pl" title="Status Page">Members</a></li>
33     <li id="register"><a href="/cgi-bin/register-form.pl" title="Register">Register</a></li>
34     <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
35 </ul>
36 </div><!-- nav -->
37 </div><!-- banner -->
38 <div id="main">
39     <h1>PostgreSQL Build Farm Log</h1>
40 <h2>Details for system "[% system %]"[% IF stage != 'OK' %] failure at stage [% stage ; ELSE %], status 'OK'[% END %], snapshot taken [% urldt %]</h2>
41 <table cellspacing="0">
42     <tr>
43         <th class="head" rowspan="2">System Information</th>
44         <th>Farm member</th>
45         <th>Branch</th>
46         <th>OS</th>
47         <th>Compiler</th>
48         <th>Architecture</th>
49         <th>Owner</th>
50     </tr>
51     <tr>
52         <td>[% system %]</td>
53         <td><a href="/cgi-bin/show_history.pl?nm=[% system %]&amp;br=[% branch %]">[% branch %]</a></td>
54         <td>[% info_row.operating_system %] [% info_row.os_version %]</td>
55         <td>[% info_row.compiler %] [% info_row.compiler_version %]</td>
56         <td>[% info_row.architecture %]</td>
57         <td>[% info_row.owner_email %]</td>
58     </tr>
59   </table>
60 [% IF info_row.sys_notes %]
61     <br />
62     <table>
63      <tr>
64        <th class="head" rowspan="2">System Notes</th>
65        <th>Date</th>
66        <th>Notes</th>
67      </tr>
68      <tr>
69       <td>[% info_row.sys_notes_date %]</td>
70       <td>[% info_row.sys_notes %]</td>
71      </tr>
72    </table>
73 [% END %]
74 [% cell = 0; FOREACH logstage  IN log_file_names ; striplog = logstage.replace('\.log$','') ; cell = loop.count %]
75   [% IF loop.first %] 
76     <br /> <table><tr><th class='head' rowspan='[% logrows %]'>Stage Logs</th>
77   [% END %]
78     [% IF loop.count > 1 and loop.count % lrfactor == 1 %]<tr>[% END %]
79     <td><a href='show_stage_log.pl?nm=[% system %]&amp;dt=[% urldt | uri %]&amp;stg=[% striplog %]'>[% striplog %]</a></td>
80     [% IF loop.count % lrfactor == 0 %]</tr>[% END %]
81 [% END %]
82
83 [% IF cell > 0 ; nrcell = cell + 1; ncells = [ nrcell .. logcells ] ; FOREACH rcell IN ncells %]
84         [% IF rcell > 1 and rcell % lrfactor == 1 %]<tr>[% END %]
85         <td>&nbsp;</td>
86         [% IF rcell % lrfactor == 0 %]</tr>[% END %]
87     [% END %]
88     </table>
89 [% END %]
90
91 <h3>Configuration summary</h3>
92 <pre>
93 [% conf | html %]
94 </pre>
95 <h3>Files changed this run</h3>
96 <pre>
97 [%- IF changed_this_run.0 -%]
98 [%- FOREACH changed IN changed_this_run %]
99 <a href="[% IF scm == 'git' ; giturl; changed.1; ELSE ; cvsurl ; changed.0; 'rev='; changed.1; END %]">[% changed.0 ; IF scm == 'cvs'; ' '; changed.1; END %]</a>
100 [%- END -%]
101 [%- ELSE %]
102 not recorded
103 [% END -%]
104 </pre>
105 [% IF stage != 'OK' %]
106 <h3>Files changed since last success</h3>
107 <pre>
108 [%- IF changed_since_success.0 %]
109 [%- FOREACH changed IN changed_since_success %]
110 <a href="[% IF scm == 'git' ; giturl; changed.1; ELSE ; cvsurl ; changed.0; 'rev='; changed.1; END %]">[% changed.0 ; IF scm == 'cvs'; ' '; changed.1; END %]</a>
111 [%- END -%]
112 [%- ELSE %]
113 not recorded
114 [% END -%]
115 </pre>
116 [% END %]
117 <h3>Log</h3>
118 <pre>
119 [% log | html %]
120 </pre>
121 </div><!-- main -->
122 <hr />
123 <p style="text-align: center;">
124 Hosting for the PostgreSQL Buildfarm is generously 
125 provided by: 
126 <a href="http://www.commandprompt.com">CommandPrompt, 
127 The PostgreSQL Company</a>
128 </p>
129 </div><!-- wrapper -->
130 </body>
131 </html>