From 3594ba942a3a9fcb4741dfd414e61dd0c807ae2a Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Wed, 26 Jan 2022 12:38:06 -0800 Subject: [PATCH] Controller/Build: use showLog in view_runcommandlog This also adds the `runcommandlog` object to the stash so that we can access its uuid as well as command run in order to display more useful and specific information on the webpage. --- src/lib/Hydra/Controller/Build.pm | 6 ++++-- src/root/runcommand-log.tt | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 1b2be1eb..af648109 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -142,10 +142,12 @@ sub view_log : Chained('buildChain') PathPart('log') { sub view_runcommandlog : Chained('buildChain') PathPart('runcommandlog') { - my ($self, $c, $uuid) = @_; + my ($self, $c, $uuid, $mode) = @_; - $c->stash->{log_uri} = $c->uri_for($c->controller('Root')->action_for("runcommandlog"), $uuid); + my $log_uri = $c->uri_for($c->controller('Root')->action_for("runcommandlog"), $uuid); + showLog($c, $mode, $log_uri); $c->stash->{template} = 'runcommand-log.tt'; + $c->stash->{runcommandlog} = $c->stash->{build}->runcommandlogs->find({ uuid => $uuid }); } diff --git a/src/root/runcommand-log.tt b/src/root/runcommand-log.tt index d1d4cd75..7d346823 100644 --- a/src/root/runcommand-log.tt +++ b/src/root/runcommand-log.tt @@ -11,10 +11,10 @@ [% ELSE %] is [% END %] - the output of a RunCommand execution of derivation [% IF step; step.drvpath; ELSE; build.drvpath; END %]. + the output of a RunCommand execution of the command [% runcommandlog.command %] + on Build [% build.id %]. [% IF tail %] - The full log is also available. + The full log is also available. [% END %]