diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 5c62b0ad..44b7a6fd 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -45,7 +45,7 @@ sub view_build : Chained('build') PathPart('') Args(0) { if (!$build->finished && $build->schedulingInfo->busy) { my $logfile = $build->schedulingInfo->logfile; - $c->stash->{logtext} = `cat $logfile` if -e $logfile; + $c->stash->{logtext} = `cat $logfile` if defined $logfile && -e $logfile; } if (defined $build->resultInfo && $build->resultInfo->iscachedbuild) { diff --git a/src/lib/Hydra/Schema/BuildSteps.pm b/src/lib/Hydra/Schema/BuildSteps.pm index 408a97ca..92320f68 100644 --- a/src/lib/Hydra/Schema/BuildSteps.pm +++ b/src/lib/Hydra/Schema/BuildSteps.pm @@ -97,6 +97,13 @@ __PACKAGE__->table("BuildSteps"); is_nullable: 1 size: undef +=head2 machine + + data_type: text + default_value: '' + is_nullable: 0 + size: undef + =cut __PACKAGE__->add_columns( @@ -178,6 +185,8 @@ __PACKAGE__->add_columns( is_nullable => 1, size => undef, }, + "machine", + { data_type => "text", default_value => "''", is_nullable => 0, size => undef }, ); __PACKAGE__->set_primary_key("build", "stepnr"); @@ -194,7 +203,7 @@ Related object: L __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }, {}); -# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-25 10:29:41 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:233eydU0CA3zcJpwDrtwwA +# Created by DBIx::Class::Schema::Loader v0.05000 @ 2010-08-31 15:40:29 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CC/XBHMiRLuQSI+nEFW50g 1; diff --git a/src/root/log.tt b/src/root/log.tt index 744ed16f..7ec61e55 100644 --- a/src/root/log.tt +++ b/src/root/log.tt @@ -1,9 +1,14 @@ [% WRAPPER layout.tt title="Logfile" %] [% PROCESS common.tt %] -

Logfile for [% INCLUDE renderFullJobNameOfBuild %] build [% build.id %][%IF step %] step [% step.stepnr %][% END %]

+

Build log of [% INCLUDE renderFullJobNameOfBuild %] build [% build.id %][%IF step %] step [% step.stepnr %][% END %]

-

Below is the logfile of the build producing Nix store path [% step.outpath %].

+

+ This is the build log of path [% IF step; step.outpath; ELSE; build.outpath; END %]. + [% IF step && step.machine %] + It was built on [% step.machine %]. + [% END %] +

[% logtext -%] diff --git a/src/script/hydra_build.pl b/src/script/hydra_build.pl index a48e81d7..c2ef427a 100755 --- a/src/script/hydra_build.pl +++ b/src/script/hydra_build.pl @@ -202,7 +202,7 @@ sub sendEmailNotification { print $email->as_string if $ENV{'HYDRA_MAIL_TEST'}; - sendmail($email); + sendmail($email); } @@ -271,6 +271,15 @@ sub doBuild { }); } + elsif (/^@\s+build-remote\s+(\S+)\s+(\S+)$/) { + my $drvPathStep = $1; + my $machine = $2; + txn_do($db, sub { + my $step = $build->buildsteps->find({stepnr => $buildSteps{$drvPathStep}}) or die; + $step->update({machine => $machine}); + }); + } + elsif (/^@\s+build-succeeded\s+(\S+)\s+(\S+)$/) { my $drvPathStep = $1; txn_do($db, sub { diff --git a/src/sql/hydra.sql b/src/sql/hydra.sql index 4e0fa43e..a6e4a8ba 100644 --- a/src/sql/hydra.sql +++ b/src/sql/hydra.sql @@ -235,6 +235,8 @@ create table BuildSteps ( startTime integer, stopTime integer, + machine text not null default '', + primary key (build, stepnr), foreign key (build) references Builds(id) on delete cascade );