forked from lix-project/hydra
* Generic declaration of build products.
This commit is contained in:
parent
2d52634b1e
commit
ffd0f75692
|
@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema';
|
|||
__PACKAGE__->load_classes;
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-06 19:19:17
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DQCaurV1oArj0odoPHR+zw
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WdXbmj1/EvPeU107AjY6zw
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -35,8 +35,8 @@ __PACKAGE__->belongs_to(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-06 19:19:17
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZDtFSXPegKbVEAoM+svosg
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GBvbApjpjiwkUQsdZg1PLg
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"build",
|
||||
|
|
|
@ -25,8 +25,8 @@ __PACKAGE__->belongs_to(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-06 19:19:17
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YwyZF3sTsIWvkKAQ5fPtMQ
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vLByOFOHkwwHa6hf8nC1Jg
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -16,8 +16,10 @@ __PACKAGE__->add_columns(
|
|||
{ data_type => "text", is_nullable => 0, size => undef },
|
||||
"path",
|
||||
{ data_type => "text", is_nullable => 0, size => undef },
|
||||
"productnr",
|
||||
{ data_type => "integer", is_nullable => 0, size => undef },
|
||||
);
|
||||
__PACKAGE__->set_primary_key("buildid", "type", "subtype");
|
||||
__PACKAGE__->set_primary_key("buildid", "productnr");
|
||||
__PACKAGE__->belongs_to(
|
||||
"buildid",
|
||||
"HydraFrontend::Schema::Builds",
|
||||
|
@ -25,8 +27,8 @@ __PACKAGE__->belongs_to(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-06 19:19:17
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:m2mxFOI2ZgjLoAzbNhiDlw
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4exGa1a3mCSv3b8Lqwu7Hw
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -55,8 +55,8 @@ __PACKAGE__->has_many(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-06 19:19:17
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jcNXcVLLxMEddBCUkq5aYg
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xsDBmgfas2tM/Dn9PE/eXQ
|
||||
|
||||
__PACKAGE__->has_many(dependentBuildInputs => 'HydraFrontend::Schema::Buildinputs', 'inputid');
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ __PACKAGE__->belongs_to(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-06 19:19:17
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YK+TrYs5Zk+8q+66b3kOUw
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8fi3nwRY3VrwApBAW6XrQQ
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -43,8 +43,8 @@ __PACKAGE__->has_many(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-06 19:19:17
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:H0KE/7kJ23s4RKFDVRIyUQ
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0uYHZfy1ZXCTLc3AsFWI0w
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -40,8 +40,8 @@ __PACKAGE__->has_many(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-06 19:19:17
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7JksbkRjqTKzHQkOvUkt2g
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:g1LPc13y/7/ngDzFqL5jXQ
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -19,8 +19,8 @@ __PACKAGE__->has_many(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-06 19:19:17
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:F3bS3Kbsxhp9G6klfVPRmg
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fIpNlZNqqGDGGWd6EORCAA
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
|
|
@ -103,13 +103,24 @@
|
|||
|
||||
<h2>Build products</h2>
|
||||
|
||||
<ul>
|
||||
<ul class="productList">
|
||||
|
||||
[% FOREACH product IN build.buildproducts -%]
|
||||
<li>
|
||||
[% SWITCH product.type %]
|
||||
[% CASE "nix-build" %]
|
||||
Nix build of path <tt>[% product.path %]</tt>
|
||||
[% CASE "file" %]
|
||||
[% SWITCH product.subtype %]
|
||||
[% CASE "source-dist" %]
|
||||
<img src="/static/images/source-dist.png" alt="Source" /> Source distribution <tt>[% product.path %]</tt>
|
||||
[% CASE "rpm" %]
|
||||
<img src="/static/images/rpm-fedora.png" alt="RPM" /> RPM package <tt>[% product.path %]</tt>
|
||||
[% CASE DEFAULT %]
|
||||
File <tt>[% product.path %]</tt> of type <tt>[% product.subtype %]</tt>
|
||||
[% END %]
|
||||
[% CASE DEFAULT %]
|
||||
Something of type <tt>[% product.type %]</tt>
|
||||
[% END %]
|
||||
</li>
|
||||
[% END -%]
|
||||
|
|
|
@ -152,6 +152,11 @@ pre.buildlog {
|
|||
padding: 0.3em;
|
||||
}
|
||||
|
||||
ul.productList {
|
||||
list-style: none;
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
|
||||
/* Sortable tables */
|
||||
|
||||
|
@ -180,4 +185,4 @@ table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSo
|
|||
|
||||
table.tablesorter thead tr th {
|
||||
padding-right: 1.5em;
|
||||
}
|
||||
}
|
||||
|
|
BIN
src/HydraFrontend/root/static/images/rpm-fedora.png
Normal file
BIN
src/HydraFrontend/root/static/images/rpm-fedora.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
src/HydraFrontend/root/static/images/source-dist.png
Normal file
BIN
src/HydraFrontend/root/static/images/source-dist.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 534 B |
|
@ -7,8 +7,6 @@ create table builds (
|
|||
jobSet text not null, -- !!! foreign key
|
||||
attrName text not null,
|
||||
|
||||
-- !!! list all the inputs / arguments
|
||||
|
||||
-- Info about the build result.
|
||||
description text,
|
||||
drvPath text not null,
|
||||
|
@ -44,10 +42,11 @@ create table buildInputs (
|
|||
|
||||
create table buildProducts (
|
||||
buildId integer not null,
|
||||
productnr integer not null,
|
||||
type text not null, -- "nix-build", "file", "doc", "report", ...
|
||||
subtype text not null, -- "sources", "rpm", ...
|
||||
subtype text not null, -- "source-dist", "rpm", ...
|
||||
path text not null,
|
||||
primary key (buildId, type, subType),
|
||||
primary key (buildId, productnr),
|
||||
foreign key (buildId) references builds(id) on delete cascade -- ignored by sqlite
|
||||
);
|
||||
|
||||
|
@ -117,3 +116,20 @@ create table jobSetInputAlts (
|
|||
primary key (project, jobset, input, altnr),
|
||||
foreign key (project, jobset, input) references jobSetInputs(project, jobset, name) on delete cascade -- ignored by sqlite
|
||||
);
|
||||
|
||||
|
||||
create table jobQueue (
|
||||
id integer primary key autoincrement not null,
|
||||
timestamp integer not null, -- time this build was added to the db (in Unix time)
|
||||
|
||||
-- Info about the inputs.
|
||||
project text not null, -- !!! foreign key
|
||||
jobSet text not null, -- !!! foreign key
|
||||
attrName text not null,
|
||||
|
||||
-- What this job will build.
|
||||
description text,
|
||||
drvPath text not null,
|
||||
outPath text not null,
|
||||
system text not null
|
||||
);
|
||||
|
|
|
@ -96,13 +96,8 @@ sub buildJob {
|
|||
|
||||
if ($outputCreated) {
|
||||
|
||||
$db->resultset('Buildproducts')->create(
|
||||
{ buildid => $build->id
|
||||
, type => "nix-build"
|
||||
, subtype => ""
|
||||
, path => $outPath
|
||||
});
|
||||
|
||||
my $productnr = 0;
|
||||
|
||||
if (-e "$outPath/log") {
|
||||
foreach my $logPath (glob "$outPath/log/*") {
|
||||
print " LOG $logPath\n";
|
||||
|
@ -114,6 +109,33 @@ sub buildJob {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (-e "$outPath/nix-support/hydra-build-products") {
|
||||
open LIST, "$outPath/nix-support/hydra-build-products" or die;
|
||||
while (<LIST>) {
|
||||
/^(\w+)\s+([\w-]+)\s+(\S+)$/ or die;
|
||||
my $type = $1;
|
||||
my $subtype = $2;
|
||||
my $path = $3;
|
||||
die unless -e $path;
|
||||
$db->resultset('Buildproducts')->create(
|
||||
{ buildid => $build->id
|
||||
, productnr => $productnr++
|
||||
, type => $type
|
||||
, subtype => $subtype
|
||||
, path => $path
|
||||
});
|
||||
}
|
||||
close LIST;
|
||||
} else {
|
||||
$db->resultset('Buildproducts')->create(
|
||||
{ buildid => $build->id
|
||||
, productnr => $productnr++
|
||||
, type => "nix-build"
|
||||
, subtype => ""
|
||||
, path => $outPath
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue