From cb8e3acb2ad65c47488537d0561d22a9471547f2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 25 Nov 2008 16:13:22 +0000 Subject: [PATCH] * Store the release name. --- src/Hydra/lib/Hydra/Schema.pm | 4 ++-- src/Hydra/lib/Hydra/Schema/Buildinputs.pm | 4 ++-- src/Hydra/lib/Hydra/Schema/Buildproducts.pm | 4 ++-- src/Hydra/lib/Hydra/Schema/Buildresultinfo.pm | 6 ++++-- src/Hydra/lib/Hydra/Schema/Builds.pm | 4 ++-- src/Hydra/lib/Hydra/Schema/Buildschedulinginfo.pm | 4 ++-- src/Hydra/lib/Hydra/Schema/Buildsteps.pm | 4 ++-- src/Hydra/lib/Hydra/Schema/Jobsetinputalts.pm | 4 ++-- src/Hydra/lib/Hydra/Schema/Jobsetinputs.pm | 4 ++-- src/Hydra/lib/Hydra/Schema/Jobsets.pm | 4 ++-- src/Hydra/lib/Hydra/Schema/Projects.pm | 4 ++-- src/Hydra/programs/Build.pl | 9 +++++++++ src/Hydra/programs/Scheduler.pl | 5 ++--- src/Hydra/root/build.tt | 6 ++++++ src/hydra.sql | 2 ++ 15 files changed, 43 insertions(+), 25 deletions(-) diff --git a/src/Hydra/lib/Hydra/Schema.pm b/src/Hydra/lib/Hydra/Schema.pm index 3d625445..1158cca5 100644 --- a/src/Hydra/lib/Hydra/Schema.pm +++ b/src/Hydra/lib/Hydra/Schema.pm @@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema'; __PACKAGE__->load_classes; -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:scYtOwO4xnXnKWlNGWyjcQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 17:11:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4eWDgovhuQLEGBA42J9kKA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Buildinputs.pm b/src/Hydra/lib/Hydra/Schema/Buildinputs.pm index d98be3ff..205c9f01 100644 --- a/src/Hydra/lib/Hydra/Schema/Buildinputs.pm +++ b/src/Hydra/lib/Hydra/Schema/Buildinputs.pm @@ -36,8 +36,8 @@ __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }); __PACKAGE__->belongs_to("dependency", "Hydra::Schema::Builds", { id => "dependency" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Nv28F7I+7azffAhYPWYTvA +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 17:11:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/SS7rITRzALAmC9rNn70cQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Buildproducts.pm b/src/Hydra/lib/Hydra/Schema/Buildproducts.pm index 1d61e983..dbc9f1a9 100644 --- a/src/Hydra/lib/Hydra/Schema/Buildproducts.pm +++ b/src/Hydra/lib/Hydra/Schema/Buildproducts.pm @@ -33,8 +33,8 @@ __PACKAGE__->set_primary_key("build", "productnr"); __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Fj95oLQNEptO9LgSfclVGQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 17:11:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:j3niyjyAmX10xY1maNh4gA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Buildresultinfo.pm b/src/Hydra/lib/Hydra/Schema/Buildresultinfo.pm index c881f35a..e770c2ff 100644 --- a/src/Hydra/lib/Hydra/Schema/Buildresultinfo.pm +++ b/src/Hydra/lib/Hydra/Schema/Buildresultinfo.pm @@ -22,13 +22,15 @@ __PACKAGE__->add_columns( { data_type => "integer", is_nullable => 0, size => undef }, "logfile", { data_type => "text", is_nullable => 0, size => undef }, + "releasename", + { data_type => "text", is_nullable => 0, size => undef }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CvVVHVHL2UEZ5XMkgf01OA +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 17:11:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/KtAIFiCb8EkAMd6OdHSXA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Builds.pm b/src/Hydra/lib/Hydra/Schema/Builds.pm index c603b079..bbd93df7 100644 --- a/src/Hydra/lib/Hydra/Schema/Builds.pm +++ b/src/Hydra/lib/Hydra/Schema/Builds.pm @@ -70,8 +70,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ty4vMjEqpl6yM81PrOtjqA +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 17:11:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ig6LUSp4zaPhrxuzC8gL4Q __PACKAGE__->has_many(dependents => 'Hydra::Schema::Buildinputs', 'dependency'); diff --git a/src/Hydra/lib/Hydra/Schema/Buildschedulinginfo.pm b/src/Hydra/lib/Hydra/Schema/Buildschedulinginfo.pm index 41d2cec1..c2dadd7e 100644 --- a/src/Hydra/lib/Hydra/Schema/Buildschedulinginfo.pm +++ b/src/Hydra/lib/Hydra/Schema/Buildschedulinginfo.pm @@ -23,8 +23,8 @@ __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:81cloGb6HT/PTPgzB8v5Tg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 17:11:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QuIbtSr8Q9JwhAcePu3Kuw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Buildsteps.pm b/src/Hydra/lib/Hydra/Schema/Buildsteps.pm index f1ec4341..b5e789d8 100644 --- a/src/Hydra/lib/Hydra/Schema/Buildsteps.pm +++ b/src/Hydra/lib/Hydra/Schema/Buildsteps.pm @@ -35,8 +35,8 @@ __PACKAGE__->set_primary_key("id", "stepnr"); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cNgqL+ZLxQirdHUa/i6mww +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 17:11:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sLsyDl8Nu63DWaYDIYBTkg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Jobsetinputalts.pm b/src/Hydra/lib/Hydra/Schema/Jobsetinputalts.pm index 4f92ebb3..a3f31e84 100644 --- a/src/Hydra/lib/Hydra/Schema/Jobsetinputalts.pm +++ b/src/Hydra/lib/Hydra/Schema/Jobsetinputalts.pm @@ -31,8 +31,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zZEUHrrOIOIg1JH0Pgi5xg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 17:11:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nL04tddxVrJnpaDHMBWkEQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Jobsetinputs.pm b/src/Hydra/lib/Hydra/Schema/Jobsetinputs.pm index b86c284b..9d1f910a 100644 --- a/src/Hydra/lib/Hydra/Schema/Jobsetinputs.pm +++ b/src/Hydra/lib/Hydra/Schema/Jobsetinputs.pm @@ -43,8 +43,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Uzlil1U0VlHnTe1tvaRO4A +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 17:11:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vPNmAznaZ6z3M8eYOwnENg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Jobsets.pm b/src/Hydra/lib/Hydra/Schema/Jobsets.pm index 71a199da..4a06e0dc 100644 --- a/src/Hydra/lib/Hydra/Schema/Jobsets.pm +++ b/src/Hydra/lib/Hydra/Schema/Jobsets.pm @@ -48,8 +48,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ednIpbErLs3gjqQd9w4KsA +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 17:11:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:juL3q644z+R8S4ynbp6MMw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Projects.pm b/src/Hydra/lib/Hydra/Schema/Projects.pm index db8d20b4..34a15f8e 100644 --- a/src/Hydra/lib/Hydra/Schema/Projects.pm +++ b/src/Hydra/lib/Hydra/Schema/Projects.pm @@ -30,8 +30,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OGLaq1Y/rLPlz+whXTZnzw +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 17:11:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:e+sS5o6q9SX12ik9beTuFQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/programs/Build.pl b/src/Hydra/programs/Build.pl index 769c7a01..f398cbb8 100644 --- a/src/Hydra/programs/Build.pl +++ b/src/Hydra/programs/Build.pl @@ -187,6 +187,14 @@ sub doBuild { my $logPath = "/nix/var/log/nix/drvs/" . basename $drvPath; $logPath = undef unless -e $logPath; + + my $releaseName; + if (-e "$outPath/nix-support/hydra-release-name") { + open FILE, "$outPath/nix-support/hydra-release-name" or die; + $releaseName = ; + chomp $releaseName; + close FILE; + } $db->resultset('Buildresultinfo')->create( { id => $build->id @@ -196,6 +204,7 @@ sub doBuild { , stoptime => $stopTime , logfile => $logPath , errormsg => $errormsg + , releasename => $releaseName }); if ($buildStatus == 0) { diff --git a/src/Hydra/programs/Scheduler.pl b/src/Hydra/programs/Scheduler.pl index f69e41df..0965b414 100644 --- a/src/Hydra/programs/Scheduler.pl +++ b/src/Hydra/programs/Scheduler.pl @@ -56,7 +56,6 @@ sub fetchInput { {rows => 1, order_by => "lastseen DESC"}); if (defined $cachedInput && isValidPath($cachedInput->storepath)) { - print "CACHED $uri $cachedInput ", $cachedInput->timestamp, " ", $cachedInput->timestamp, "\n"; $storePath = $cachedInput->storepath; $sha256 = $cachedInput->sha256hash; $timestamp = $cachedInput->timestamp; @@ -232,7 +231,7 @@ sub checkJobAlternatives { my @newArgs = @{$extraArgs}; if (defined $inputInfo->{$argName}->{storePath}) { push @newArgs, "--arg", $argName, - "{path = " . $inputInfo->{$argName}->{storePath} . ";" . + "{path = builtins.storePath " . $inputInfo->{$argName}->{storePath} . ";" . " rev = \"" . $inputInfo->{$argName}->{revision} . "\";}"; } elsif (defined $inputInfo->{$argName}->{value}) { push @newArgs, "--argstr", $argName, $inputInfo->{$argName}->{value}; @@ -268,7 +267,7 @@ sub checkJobAlternatives { }; my @newArgs = @{$extraArgs}; - push @newArgs, "--arg", $argName, "{path = " . $prevBuild->outpath . ";}"; + push @newArgs, "--arg", $argName, "{path = builtins.storePath " . $prevBuild->outpath . ";}"; checkJobAlternatives( $project, $jobset, $inputInfo, $nixExprPath, diff --git a/src/Hydra/root/build.tt b/src/Hydra/root/build.tt index 36a34df6..bd4ec5a5 100644 --- a/src/Hydra/root/build.tt +++ b/src/Hydra/root/build.tt @@ -102,6 +102,12 @@ [% END %] + [% IF build.resultInfo.releasename %] + + Release name: + [% HTML.escape(build.resultInfo.releasename) %] + + [% END %] [% IF build.resultInfo.logfile %] Logfile: diff --git a/src/hydra.sql b/src/hydra.sql index e99dd158..0f8ee1bb 100644 --- a/src/hydra.sql +++ b/src/hydra.sql @@ -61,6 +61,8 @@ create table BuildResultInfo ( stopTime integer, logfile text, -- the path of the logfile + + releaseName text, -- e.g. "patchelf-0.5pre1234" foreign key (id) references Builds(id) on delete cascade -- ignored by sqlite );