* hydra: on build page, show tail of log on first tab when buildstatus == 1 (this specific build failed)

This commit is contained in:
Rob Vermaas 2010-02-05 20:32:07 +00:00
parent 045d921f7d
commit 348db7600c
2 changed files with 8 additions and 1 deletions

View file

@ -43,6 +43,12 @@ sub view_build : Chained('build') PathPart('') Args(0) {
(my $cachedBuildStep) = $c->model('DB::BuildSteps')->search({ outpath => $build->outpath }, {}) ; (my $cachedBuildStep) = $c->model('DB::BuildSteps')->search({ outpath => $build->outpath }, {}) ;
$c->stash->{cachedBuild} = $cachedBuildStep->build if defined $cachedBuildStep; $c->stash->{cachedBuild} = $cachedBuildStep->build if defined $cachedBuildStep;
} }
(my $lastBuildStep) = $build->buildsteps->search({},{order_by => "stepnr", rows => 1});
if ($build->resultInfo->buildstatus == 1 && $lastBuildStep && isValidPath($lastBuildStep->logfile)) {
my $path = $lastBuildStep->logfile;
$c->stash->{logtext} = `tail -n 50 $path`;
}
} }

View file

@ -189,7 +189,8 @@
[% HTML.escape(build.resultInfo.errormsg) -%] [% HTML.escape(build.resultInfo.errormsg) -%]
</pre> </pre>
[% END %] [% END %]
[% ELSIF build.schedulingInfo.busy %] [% END %]
[% IF logtext %]
<h2>Log</h2> <h2>Log</h2>
<pre class="buildlog"> <pre class="buildlog">