From fe149613b316f70f134fcc9ca3ca14065523a899 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 19 Nov 2021 15:21:45 -0500 Subject: [PATCH] Builds page: show RunCommand logs --- src/lib/Hydra/Controller/Build.pm | 1 + src/root/build.tt | 53 ++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index d05aef51..bde1030e 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -37,6 +37,7 @@ sub buildChain :Chained('/') :PathPart('build') :CaptureArgs(1) { $c->stash->{project} = $c->stash->{build}->project; $c->stash->{jobset} = $c->stash->{build}->jobset; $c->stash->{job} = $c->stash->{build}->job; + $c->stash->{runcommandlogs} = [$c->stash->{build}->runcommandlogs->search({}, {order_by => ["id DESC"]})]; } diff --git a/src/root/build.tt b/src/root/build.tt index 30014dec..d5222469 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -149,6 +149,7 @@ END; [% IF build.dependents %][% END%] [% IF drvAvailable %][% END %] [% IF localStore && available %][% END %] +
@@ -477,7 +478,7 @@ END;
- [% END %] +[% END %] [% IF drvAvailable %] [% INCLUDE makeLazyTab tabName="tabs-build-deps" uri=c.uri_for('/build' build.id 'build-deps') %] @@ -487,6 +488,56 @@ END; [% INCLUDE makeLazyTab tabName="tabs-runtime-deps" uri=c.uri_for('/build' build.id 'runtime-deps') %] [% END %] +
+
+ [% FOREACH runcommandlog IN runcommandlogs %] +
+
+
+ [% IF runcommandlog.did_succeed() %] + Succeeded + [% ELSIF runcommandlog.is_running() %] + + [% ELSE %] + Failed + [% END %] +
+ +
+
[% runcommandlog.command | html%]
+
+ [% IF not runcommandlog.is_running() %] + [% IF runcommandlog.did_fail_with_signal() %] + Exit signal: [% runcommandlog.signal %] + [% IF runcommandlog.core_dumped %] + (Core Dumped) + [% END %] + [% ELSIF runcommandlog.did_fail_with_exec_error() %] + Exec error: [% runcommandlog.error_number %] + [% ELSIF not runcommandlog.did_succeed() %] + Exit code: [% runcommandlog.exit_code %] + [% END %] + [% END %] +
+
+ +
+ [% IF runcommandlog.start_time != undef %] +
Started at [% INCLUDE renderDateTime timestamp = runcommandlog.start_time; %]
+ [% IF runcommandlog.end_time != undef %] +
Ran for [% INCLUDE renderDuration duration = runcommandlog.end_time - runcommandlog.start_time %]
+ [% ELSE %] +
Running for [% INCLUDE renderDuration duration = curTime - runcommandlog.start_time %]
+ [% END %] + [% ELSE %] +
Pending
+ [% END %] +
+
+
+ [% END %] +
+