diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 8bc129be..6322f257 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -38,6 +38,12 @@ sub view_build : Chained('build') PathPart('') Args(0) { my $logfile = $build->schedulingInfo->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; + } + } diff --git a/src/root/build.tt b/src/root/build.tt index 09cd78fa..9f9366d7 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -150,6 +150,13 @@ [% INCLUDE renderDateTime timestamp = build.timestamp %] [% IF build.finished && build.resultInfo.buildstatus != 4 %] + [% IF build.resultInfo.iscachedbuild %] + + Cached build: + [% cachedBuild.id %] + + [% END %] + Build started: [% IF build.resultInfo.starttime %][% INCLUDE renderDateTime timestamp = build.resultInfo.starttime %][% ELSE %](cached build)[% END %]