Author: eelco
Date: Tue Aug 31 14:08:59 2010
New Revision: 23563
URL: https://svn.nixos.org/websvn/nix/?rev=23563&sc=1

Log:
* Store the name of the machine that performed a build step in the
  BuildSteps table.

Modified:
   hydra/trunk/src/lib/Hydra/Controller/Build.pm
   hydra/trunk/src/lib/Hydra/Schema/BuildSteps.pm
   hydra/trunk/src/root/log.tt
   hydra/trunk/src/script/hydra_build.pl
   hydra/trunk/src/sql/hydra.sql

Modified: hydra/trunk/src/lib/Hydra/Controller/Build.pm
==============================================================================
--- hydra/trunk/src/lib/Hydra/Controller/Build.pm       Tue Aug 31 13:18:12 
2010        (r23562)
+++ hydra/trunk/src/lib/Hydra/Controller/Build.pm       Tue Aug 31 14:08:59 
2010        (r23563)
@@ -45,7 +45,7 @@
 
     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) {

Modified: hydra/trunk/src/lib/Hydra/Schema/BuildSteps.pm
==============================================================================
--- hydra/trunk/src/lib/Hydra/Schema/BuildSteps.pm      Tue Aug 31 13:18:12 
2010        (r23562)
+++ hydra/trunk/src/lib/Hydra/Schema/BuildSteps.pm      Tue Aug 31 14:08:59 
2010        (r23563)
@@ -97,6 +97,13 @@
   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 @@
     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 @@
 __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;

Modified: hydra/trunk/src/root/log.tt
==============================================================================
--- hydra/trunk/src/root/log.tt Tue Aug 31 13:18:12 2010        (r23562)
+++ hydra/trunk/src/root/log.tt Tue Aug 31 14:08:59 2010        (r23563)
@@ -1,9 +1,14 @@
 [% WRAPPER layout.tt title="Logfile" %]
 [% PROCESS common.tt %]
 
-<h1>Logfile for [% INCLUDE renderFullJobNameOfBuild %] build [% build.id 
%][%IF step %] step [% step.stepnr %][% END %]</h1>
+<h1>Build log of [% INCLUDE renderFullJobNameOfBuild %] build <a href="[% 
c.uri_for('/build' build.id) %]">[% build.id %]</a>[%IF step %] step [% 
step.stepnr %][% END %]</h1>
 
-<p>Below is the logfile of the <a href="[% c.uri_for('/build' build.id) 
%]">build</a> producing Nix store path <tt>[% step.outpath %]</tt>.</p>
+<p>
+  This is the build log of path <tt>[% IF step; step.outpath; ELSE; 
build.outpath; END %]</tt>.
+  [% IF step && step.machine %]
+    It was built on <tt>[% step.machine %]</tt>.
+  [% END %]
+</p>
 
 <div class="buildlog">
 [% logtext -%]

Modified: hydra/trunk/src/script/hydra_build.pl
==============================================================================
--- hydra/trunk/src/script/hydra_build.pl       Tue Aug 31 13:18:12 2010        
(r23562)
+++ hydra/trunk/src/script/hydra_build.pl       Tue Aug 31 14:08:59 2010        
(r23563)
@@ -202,7 +202,7 @@
 
     print $email->as_string if $ENV{'HYDRA_MAIL_TEST'};
 
-   sendmail($email);
+    sendmail($email);
 }
 
 
@@ -271,6 +271,15 @@
                 });
             }
             
+            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 {

Modified: hydra/trunk/src/sql/hydra.sql
==============================================================================
--- hydra/trunk/src/sql/hydra.sql       Tue Aug 31 13:18:12 2010        (r23562)
+++ hydra/trunk/src/sql/hydra.sql       Tue Aug 31 14:08:59 2010        (r23563)
@@ -235,6 +235,8 @@
     startTime     integer,
     stopTime      integer,
 
+    machine       text not null default '',
+
     primary key   (build, stepnr),
     foreign key   (build) references Builds(id) on delete cascade
 );
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to