add missing copyright notice
[buildfarm-server.git] / templates / log.tt
1 [%#
2
3 Copyright (c) 2003-2010, Andrew Dunstan
4
5 See accompanying License file for license details
6
7 -%]
8 [% PERL %]
9         use POSIX qw(ceil);
10         my $lrfactor = 6;
11         $stash->set(lrfactor => $lrfactor);
12         my $rows = $stash->get('log_file_names'); 
13         my $logrows = ceil(scalar(@$rows)/$lrfactor);
14         my $logcells = $lrfactor * $logrows;
15         $stash->set( logcells => $logcells);
16         $stash->set( logrows => $logrows ); 
17 [% END -%]
18 [% mytitle = BLOCK %]PostgreSQL BuildFarm | [% IF stage != 'OK' %]Log for system "[% system %]" failure on snapshot taken [% urldt ; ELSE %]Configuration summary for system "[% system %]" snapshot taken [% urldt ; END ; END -%]
19 [%
20         cvsurl = 'http://anoncvs.postgresql.org/cvsweb.cgi';
21         giturl = scmurl || 'http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=';
22 -%]
23 [% WRAPPER 'page.tt' 
24         title = mytitle
25         bodyclass = 'none'
26         pagebutton = 'none'
27 %]
28 [%- BLOCK gitlog ;
29         loglines = clog.split('\n');
30         firstline = loglines.shift;
31         commitref = firstline.replace('commit ([0-9A-Fa-f]+)','$1');
32 %]
33 commit <a href="[% giturl ; commitref %]">[% commitref %]</a>
34 [% loglines.join("\n")  | html %]
35
36 [% END -%]
37 <h1>PostgreSQL Build Farm Log</h1>
38 <h2>Details for system "[% system %]"[% IF stage != 'OK' %] failure at stage [% stage ; ELSE %], status 'OK'[% END %], snapshot taken [% urldt %]</h2>
39 <table cellspacing="0">
40     <tr>
41         <th class="head" rowspan="2">System Information</th>
42         <th>Farm member</th>
43         <th>Branch</th>
44         <th>OS</th>
45         <th>Compiler</th>
46         <th>Architecture</th>
47         <th>Owner</th>
48     </tr>
49     <tr>
50         <td>[% system %]</td>
51         <td><a href="/cgi-bin/show_history.pl?nm=[% system %]&amp;br=[% branch %]">[% branch %]</a></td>
52         <td>[% info_row.operating_system %] [% info_row.os_version %]</td>
53         <td>[% info_row.compiler %] [% info_row.compiler_version %]</td>
54         <td>[% info_row.architecture %]</td>
55         <td>[% info_row.owner_email %]</td>
56     </tr>
57   </table>
58 [% IF info_row.sys_notes %]
59     <br />
60     <table>
61      <tr>
62        <th class="head" rowspan="2">System Notes</th>
63        <th>Date</th>
64        <th>Notes</th>
65      </tr>
66      <tr>
67       <td>[% info_row.sys_notes_date %]</td>
68       <td>[% info_row.sys_notes %]</td>
69      </tr>
70    </table>
71 [% END %]
72 [% cell = 0; FOREACH logstage  IN log_file_names ; striplog = logstage.replace('\.log$','') ; cell = loop.count %]
73   [% IF loop.first %] 
74     <br /> <table><tr><th class='head' rowspan='[% logrows %]'>Stage Logs</th>
75   [% END %]
76     [% IF loop.count > 1 and loop.count % lrfactor == 1 %]<tr>[% END %]
77     <td><a href='show_stage_log.pl?nm=[% system %]&amp;dt=[% urldt | uri %]&amp;stg=[% striplog %]'>[% striplog %]</a></td>
78     [% IF loop.count % lrfactor == 0 %]</tr>[% END %]
79 [% END %]
80
81 [% IF cell > 0 ; nrcell = cell + 1; ncells = [ nrcell .. logcells ] ; FOREACH rcell IN ncells %]
82         [% IF rcell > 1 and rcell % lrfactor == 1 %]<tr>[% END %]
83         <td>&nbsp;</td>
84         [% IF rcell % lrfactor == 0 %]</tr>[% END %]
85     [% END %]
86     </table>
87 [% END %]
88
89 <h3>Configuration summary</h3>
90 <pre>
91 [% conf | html %]
92 </pre>
93 <h3>Files changed this run</h3>
94 [%- IF changed_this_run.0 -%]
95 <pre>
96 [%- FOREACH changed IN changed_this_run %]
97 <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>
98 [%- END -%]
99 </pre>
100 [% END %]
101 [% IF changed_this_run_logs.0 %]
102 <h5>Git log</h5>
103 <blockquote><pre>
104 [%- FOREACH clog IN changed_this_run_logs ; PROCESS gitlog -%]
105 [%IF not loop.last %]
106 ===================================================================
107 [% END -%]
108 [%- END -%]
109 </pre></blockquote>
110 [%- ELSE %]
111 <pre>
112 not recorded
113 </pre>
114 [% END -%]
115 [% IF stage != 'OK' %]
116 <h3>Files changed since last success</h3>
117 [%- IF changed_since_success.0 %]
118 <pre>
119 [%- FOREACH changed IN changed_since_success %]
120 <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>
121 [%- END -%]
122 </pre>
123 [% END %]
124 [% IF changed_since_success_logs.0 %]
125 <h5>Git log</h5>
126 <blockquote><pre>
127 [%- FOREACH clog IN changed_since_success_logs ; PROCESS gitlog -%]
128 [%IF not loop.last %]
129 ===================================================================
130 [% END -%]
131 [%- END -%]
132 </pre></blockquote>
133 [%- ELSE %]
134 <pre>
135 not recorded
136 </pre>
137 [% END -%]
138 [% END %]
139 <h3>Log</h3>
140 <pre>
141 [% log | html %]
142 </pre>
143 [% END %]