This commit is contained in:
Eelco Dolstra 2008-11-12 16:42:07 +00:00
parent b96d304c85
commit 08f171d9e8
17 changed files with 61 additions and 40 deletions

View file

@ -180,7 +180,8 @@ sub download :Local {
} }
} }
my $path = $product->path . "/" . join("/", @path); my $path = $product->path;
$path .= "/" . join("/", @path) if scalar @path > 0;
# If this is a directory but no "/" is attached, then redirect. # If this is a directory but no "/" is attached, then redirect.
if (-d $path && substr($c->request->uri, -1) ne "/") { if (-d $path && substr($c->request->uri, -1) ne "/") {

View file

@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema';
__PACKAGE__->load_classes; __PACKAGE__->load_classes;
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:B5e2QLKoLZK5s4Ntc5MuAA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:F1nSglXZOlZaa+DozFyuSw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -38,8 +38,8 @@ __PACKAGE__->belongs_to(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gB3bnV6S6yuAk1ojYmaI8g # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6AC1Vo2bOr42lKnrBq/OJg
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -21,8 +21,8 @@ __PACKAGE__->set_primary_key("build", "logphase");
__PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" }); __PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IfVP+l5/yBO6808VOMNADQ # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fdoYDJVZVm+i55Fx3tAN9Q
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -33,8 +33,8 @@ __PACKAGE__->set_primary_key("build", "productnr");
__PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" }); __PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pY4RxKVCMKfiBDtNNXeBng # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N+3MtBcrTGOC3emLB+xNRQ
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -25,8 +25,8 @@ __PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" }); __PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wYS1iVMAyN/RtZG1Obi9tw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YMeFW1JK1ChtsgKbur76Mg
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -20,6 +20,8 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 0, size => undef }, { data_type => "text", is_nullable => 0, size => undef },
"attrname", "attrname",
{ data_type => "text", is_nullable => 0, size => undef }, { data_type => "text", is_nullable => 0, size => undef },
"nixname",
{ data_type => "text", is_nullable => 0, size => undef },
"description", "description",
{ data_type => "text", is_nullable => 0, size => undef }, { data_type => "text", is_nullable => 0, size => undef },
"drvpath", "drvpath",
@ -50,6 +52,11 @@ __PACKAGE__->has_many(
"HydraFrontend::Schema::Buildresultinfo", "HydraFrontend::Schema::Buildresultinfo",
{ "foreign.id" => "self.id" }, { "foreign.id" => "self.id" },
); );
__PACKAGE__->has_many(
"buildsteps",
"HydraFrontend::Schema::Buildsteps",
{ "foreign.id" => "self.id" },
);
__PACKAGE__->has_many( __PACKAGE__->has_many(
"buildinputs_builds", "buildinputs_builds",
"HydraFrontend::Schema::Buildinputs", "HydraFrontend::Schema::Buildinputs",
@ -60,25 +67,20 @@ __PACKAGE__->has_many(
"HydraFrontend::Schema::Buildinputs", "HydraFrontend::Schema::Buildinputs",
{ "foreign.dependency" => "self.id" }, { "foreign.dependency" => "self.id" },
); );
__PACKAGE__->has_many(
"buildlogs",
"HydraFrontend::Schema::Buildlogs",
{ "foreign.build" => "self.id" },
);
__PACKAGE__->has_many(
"buildsteps",
"HydraFrontend::Schema::Buildsteps",
{ "foreign.id" => "self.id" },
);
__PACKAGE__->has_many( __PACKAGE__->has_many(
"buildproducts", "buildproducts",
"HydraFrontend::Schema::Buildproducts", "HydraFrontend::Schema::Buildproducts",
{ "foreign.build" => "self.id" }, { "foreign.build" => "self.id" },
); );
__PACKAGE__->has_many(
"buildlogs",
"HydraFrontend::Schema::Buildlogs",
{ "foreign.build" => "self.id" },
);
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1fLVr/70ZuAOfnMp3rMzxg # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mfQ486yZBf8hAuPUAT3rNw
__PACKAGE__->has_many(dependents => 'HydraFrontend::Schema::Buildinputs', 'dependency'); __PACKAGE__->has_many(dependents => 'HydraFrontend::Schema::Buildinputs', 'dependency');

View file

@ -23,8 +23,8 @@ __PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" }); __PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iRPGs/gpDnzo1PxQxG7xvw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KGrBqaYWcJJW8YWfTxU2aA
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -35,8 +35,8 @@ __PACKAGE__->set_primary_key("id", "stepnr");
__PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" }); __PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mhkF1c7eX7lD/XrssbCZvA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zjPeAZwkkJ7hZ5LZ00fm1A
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -33,8 +33,8 @@ __PACKAGE__->belongs_to(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hxSSWmfGbKz1L3Qcd3/3Vw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9qIw6bpHy7bKDNI3g1WKMA
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -43,8 +43,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PWJ32W99n1Zw44Rhj5P1Pg # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OL3rSmVxWsUJoeaUieZGJA
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -48,8 +48,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FVgzVxkslYSC4yoG9JxA+A # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ed14Jg43pSHx6rNdYW6kLg
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -24,8 +24,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Gj8h9Nexy9HmrFNeH2bWCQ # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qzleHgS4oapKEZ8hPyB3Sw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -56,7 +56,11 @@
</tr> </tr>
<tr> <tr>
<th>Job name:</th> <th>Job name:</th>
<td><a href="[% c.uri_for('/job' build.project build.attrname) %]"><tt>[% build.attrname %]</tt></a></td> <td><a href="[% c.uri_for('/job' build.project.name build.attrname) %]"><tt>[% build.attrname %]</tt></a></td>
</tr>
<tr>
<th>Nix name:</th>
<td><tt>[% build.nixname %]</tt></td>
</tr> </tr>
<tr> <tr>
<th>Description:</th> <th>Description:</th>
@ -101,7 +105,7 @@
[% IF build.schedulingInfo.busy %] [% IF build.schedulingInfo.busy %]
<tr> <tr>
<th>Logfile:</th> <th>Logfile:</th>
<td>[% build.schedulingInfo.logfile %]</td> <td><tt>[% build.schedulingInfo.logfile %]</tt></td>
</tr> </tr>
[% END %] [% END %]
[% END %] [% END %]
@ -238,6 +242,17 @@
[% END %] [% END %]
</a> </a>
[% CASE "doc" %]
<a href="[% c.uri_for('/download' build.id product.productnr product.name) %]">
[% SWITCH product.subtype %]
[% CASE "readme" %]
“README” file
[% CASE DEFAULT %]
Documentation of type <tt>[% product.subtype %]</tt>
[% END %]
</a>
[% CASE DEFAULT %] [% CASE DEFAULT %]
Something of type <tt>[% product.type %]</tt> Something of type <tt>[% product.type %]</tt>

View file

@ -215,9 +215,9 @@ sub doBuild {
if (-e "$outPath/nix-support/hydra-build-products") { if (-e "$outPath/nix-support/hydra-build-products") {
open LIST, "$outPath/nix-support/hydra-build-products" or die; open LIST, "$outPath/nix-support/hydra-build-products" or die;
while (<LIST>) { while (<LIST>) {
/^(\w+)\s+([\w-]+)\s+(\S+)$/ or die; /^([\w\-]+)\s+([\w\-]+)\s+(\S+)$/ or next;
my $type = $1; my $type = $1;
my $subtype = $2; my $subtype = $2 eq "none" ? "" : $2;
my $path = $3; my $path = $3;
die unless -e $path; die unless -e $path;
@ -225,7 +225,7 @@ sub doBuild {
if (-f $path) { if (-f $path) {
my $st = stat($path) or die "cannot stat $path: $!"; my $st = stat($path) or die "cannot stat $path: $!";
$fileSize = $st; $fileSize = $st->size;
$sha1 = `nix-hash --flat --type sha1 $path` $sha1 = `nix-hash --flat --type sha1 $path`
or die "cannot hash $path: $?";; or die "cannot hash $path: $?";;
@ -258,6 +258,7 @@ sub doBuild {
, type => "nix-build" , type => "nix-build"
, subtype => "" , subtype => ""
, path => $outPath , path => $outPath
, name => $build->nixname
}); });
} }
} }

View file

@ -17,6 +17,7 @@ create table Builds (
attrName text not null, attrName text not null,
-- Info about the build result. -- Info about the build result.
nixName text, -- name attribute of the derivation
description text, description text,
drvPath text not null, drvPath text not null,
outPath text not null, outPath text not null,

View file

@ -80,6 +80,7 @@ sub checkJob {
, jobset => $jobset->name , jobset => $jobset->name
, attrname => $jobName , attrname => $jobName
, description => $description , description => $description
, nixname => $job->{name}
, drvpath => $drvPath , drvpath => $drvPath
, outpath => $outPath , outpath => $outPath
, system => $job->{system} , system => $job->{system}