forked from lix-project/hydra
runcommand-log.tt: init
This commit is contained in:
parent
796ce165d4
commit
14090fbb86
|
@ -140,9 +140,8 @@ sub view_log : Chained('buildChain') PathPart('log') {
|
||||||
sub view_runcommand_log : Chained('buildChain') PathPart('runcommand-log') {
|
sub view_runcommand_log : Chained('buildChain') PathPart('runcommand-log') {
|
||||||
my ($self, $c, $sha) = @_;
|
my ($self, $c, $sha) = @_;
|
||||||
|
|
||||||
$c->stash->{is_runcommand} = 1;
|
|
||||||
$c->stash->{log_uri} = $c->uri_for($c->controller('Root')->action_for("runcommandlog"), $sha . "-" . $c->stash->{build}->id);
|
$c->stash->{log_uri} = $c->uri_for($c->controller('Root')->action_for("runcommandlog"), $sha . "-" . $c->stash->{build}->id);
|
||||||
$c->stash->{template} = 'log.tt';
|
$c->stash->{template} = 'runcommand-log.tt';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[% WRAPPER layout.tt
|
[% WRAPPER layout.tt
|
||||||
titleHTML=(is_runcommand ? "RunCommand log of " : "Log of ") _ (step ? " step $step.stepnr of " : "") _ "build ${build.id} of job " _ linkToJob(build.jobset, job)
|
titleHTML="Log of " _ (step ? " step $step.stepnr of " : "") _ "build ${build.id} of job " _ linkToJob(build.jobset, job)
|
||||||
title=(is_runcommand ? "RunCommand log of " : "Log of ") _ (step ? " step $step.stepnr of " : "") _ "build ${build.id} of job " _ makeNameTextForJob(build.jobset, job)
|
title="Log of " _ (step ? " step $step.stepnr of " : "") _ "build ${build.id} of job " _ makeNameTextForJob(build.jobset, job)
|
||||||
%]
|
%]
|
||||||
[% PROCESS common.tt %]
|
[% PROCESS common.tt %]
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
[% ELSE %]
|
[% ELSE %]
|
||||||
is
|
is
|
||||||
[% END %]
|
[% END %]
|
||||||
[% IF is_runcommand %] the output of a RunCommand execution of[% ELSE %] the build log of[% END %] derivation <tt>[% IF step; step.drvpath; ELSE; build.drvpath; END %]</tt>.
|
the build log of derivation <tt>[% IF step; step.drvpath; ELSE; build.drvpath; END %]</tt>.
|
||||||
[% IF step && step.machine %]
|
[% IF step && step.machine %]
|
||||||
It was built on <tt>[% step.machine %]</tt>.
|
It was built on <tt>[% step.machine %]</tt>.
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
49
src/root/runcommand-log.tt
Normal file
49
src/root/runcommand-log.tt
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
[% WRAPPER layout.tt
|
||||||
|
titleHTML="RunCommand log of " _ (step ? " step $step.stepnr of " : "") _ "build ${build.id} of job " _ linkToJob(build.jobset, job)
|
||||||
|
title="RunCommand log of " _ (step ? " step $step.stepnr of " : "") _ "build ${build.id} of job " _ makeNameTextForJob(build.jobset, job)
|
||||||
|
%]
|
||||||
|
[% PROCESS common.tt %]
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Below
|
||||||
|
[% IF tail %]
|
||||||
|
are the last lines of
|
||||||
|
[% ELSE %]
|
||||||
|
is
|
||||||
|
[% END %]
|
||||||
|
the output of a RunCommand execution of derivation <tt>[% IF step; step.drvpath; ELSE; build.drvpath; END %]</tt>.
|
||||||
|
[% IF tail %]
|
||||||
|
The <a href="[% step ? c.uri_for('/build' build.id 'nixlog' step.stepnr)
|
||||||
|
: c.uri_for('/build' build.id 'log') %]">full log</a> is also available.
|
||||||
|
[% END %]
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="card bg-light"><div class="card-body"><pre class="log" id="contents">
|
||||||
|
<em>Loading...</em>
|
||||||
|
</pre></div></div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
requestPlainFile({
|
||||||
|
url: "[% HTML.escape(log_uri) %]",
|
||||||
|
dataType: "text",
|
||||||
|
type: 'GET',
|
||||||
|
success: function (log_data) {
|
||||||
|
|
||||||
|
[% IF tail %]
|
||||||
|
/* The server may give us a full log (e.g. if the log is in
|
||||||
|
S3). So extract the last lines. */
|
||||||
|
log_data = log_data.split("\n").slice(-[%tail%]).join("\n");
|
||||||
|
[% END %]
|
||||||
|
|
||||||
|
$("#contents").text(log_data);
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
bootbox.alert("The RunCommand log file is not available.");
|
||||||
|
$("#contents").text("(Unavailable)");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
[% END %]
|
Loading…
Reference in a new issue