hydra: in case of cached build, add link to build that built the storepath

This commit is contained in:
Rob Vermaas 2010-01-15 14:18:12 +00:00
parent 3bed0863a5
commit 63db13be3f
2 changed files with 13 additions and 0 deletions

View file

@ -38,6 +38,12 @@ sub view_build : Chained('build') PathPart('') Args(0) {
my $logfile = $build->schedulingInfo->logfile; my $logfile = $build->schedulingInfo->logfile;
$c->stash->{logtext} = `cat $logfile` if -e $logfile; $c->stash->{logtext} = `cat $logfile` if -e $logfile;
} }
if (defined $build->resultInfo && $build->resultInfo->iscachedbuild) {
(my $cachedBuildStep) = $c->model('DB::BuildSteps')->search({ outpath => $build->outpath }, {}) ;
$c->stash->{cachedBuild} = $cachedBuildStep->build;
}
} }

View file

@ -150,6 +150,13 @@
<td>[% INCLUDE renderDateTime timestamp = build.timestamp %]</td> <td>[% INCLUDE renderDateTime timestamp = build.timestamp %]</td>
</tr> </tr>
[% IF build.finished && build.resultInfo.buildstatus != 4 %] [% IF build.finished && build.resultInfo.buildstatus != 4 %]
[% IF build.resultInfo.iscachedbuild %]
<tr>
<th>Cached build:</th>
<td><a href="[% c.uri_for('/build' cachedBuild.id ) %]">[% cachedBuild.id %]</a></td>
</tr>
[% END %]
<tr> <tr>
<th>Build started:</th> <th>Build started:</th>
<td>[% IF build.resultInfo.starttime %][% INCLUDE renderDateTime timestamp = build.resultInfo.starttime %][% ELSE %]<em>(cached build)</em>[% END %]</td> <td>[% IF build.resultInfo.starttime %][% INCLUDE renderDateTime timestamp = build.resultInfo.starttime %][% ELSE %]<em>(cached build)</em>[% END %]</td>