forked from lix-project/hydra
hydra: make nr of build to keep configurable per jobset
This commit is contained in:
parent
34e309f0f7
commit
9d9bf8b264
|
@ -231,6 +231,7 @@ sub updateJobset {
|
|||
, enabled => trim($c->request->params->{enabled}) eq "1" ? 1 : 0
|
||||
, enableemail => trim($c->request->params->{enableemail}) eq "1" ? 1 : 0
|
||||
, emailoverride => trim($c->request->params->{emailoverride})
|
||||
, keepnr => trim($c->request->params->{keepnr})
|
||||
});
|
||||
|
||||
my %inputNames;
|
||||
|
|
|
@ -40,20 +40,6 @@ __PACKAGE__->table("CachedGitInputs");
|
|||
is_nullable: 0
|
||||
size: undef
|
||||
|
||||
=head2 timestamp
|
||||
|
||||
data_type: integer
|
||||
default_value: undef
|
||||
is_nullable: 0
|
||||
size: undef
|
||||
|
||||
=head2 lastseen
|
||||
|
||||
data_type: integer
|
||||
default_value: undef
|
||||
is_nullable: 0
|
||||
size: undef
|
||||
|
||||
=head2 sha256hash
|
||||
|
||||
data_type: text
|
||||
|
@ -92,20 +78,6 @@ __PACKAGE__->add_columns(
|
|||
is_nullable => 0,
|
||||
size => undef,
|
||||
},
|
||||
"timestamp",
|
||||
{
|
||||
data_type => "integer",
|
||||
default_value => undef,
|
||||
is_nullable => 0,
|
||||
size => undef,
|
||||
},
|
||||
"lastseen",
|
||||
{
|
||||
data_type => "integer",
|
||||
default_value => undef,
|
||||
is_nullable => 0,
|
||||
size => undef,
|
||||
},
|
||||
"sha256hash",
|
||||
{
|
||||
data_type => "text",
|
||||
|
@ -124,7 +96,7 @@ __PACKAGE__->add_columns(
|
|||
__PACKAGE__->set_primary_key("uri", "branch", "revision");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-25 10:29:41
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CoeyzZHUEPo7/VpIpLD+Pw
|
||||
# Created by DBIx::Class::Schema::Loader v0.05000 @ 2010-08-10 08:24:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4eYbLtiy5X3yegndBRFtSg
|
||||
|
||||
1;
|
||||
|
|
|
@ -106,6 +106,13 @@ __PACKAGE__->table("Jobsets");
|
|||
is_nullable: 0
|
||||
size: undef
|
||||
|
||||
=head2 keepnr
|
||||
|
||||
data_type: integer
|
||||
default_value: 3
|
||||
is_nullable: 0
|
||||
size: undef
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
|
@ -181,6 +188,8 @@ __PACKAGE__->add_columns(
|
|||
is_nullable => 0,
|
||||
size => undef,
|
||||
},
|
||||
"keepnr",
|
||||
{ data_type => "integer", default_value => 3, is_nullable => 0, size => undef },
|
||||
);
|
||||
__PACKAGE__->set_primary_key("project", "name");
|
||||
|
||||
|
@ -280,7 +289,7 @@ __PACKAGE__->has_many(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.05000 @ 2010-06-04 16:32:43
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aQ+7TLIXnNDjjulPNqLq7A
|
||||
# Created by DBIx::Class::Schema::Loader v0.05000 @ 2010-08-10 08:24:15
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:b/GSJQxUcjCP4fn3peJVMg
|
||||
|
||||
1;
|
||||
|
|
|
@ -194,6 +194,12 @@
|
|||
<td>
|
||||
[% INCLUDE maybeEditString param="emailoverride" value=jobset.emailoverride %]
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Number of builds to keep:</th>
|
||||
<td>
|
||||
[% INCLUDE maybeEditString param="keepnr" value=jobset.keepnr %]
|
||||
</td>
|
||||
</tr>
|
||||
[% IF !edit %]
|
||||
<tr>
|
||||
|
|
|
@ -47,7 +47,7 @@ foreach my $project ($db->resultset('Projects')->search({hidden => 0},{})) {
|
|||
# !!! Take time into account? E.g. don't delete builds that
|
||||
# are younger than N days.
|
||||
my @systems = $job->builds->search({ }, { select => ["system"], distinct => 1 })->all;
|
||||
|
||||
my $keepnr = $job->jobset->keepnr ;
|
||||
foreach my $system (@systems) {
|
||||
my @recentBuilds = $job->builds->search(
|
||||
{ finished => 1
|
||||
|
@ -56,7 +56,7 @@ foreach my $project ($db->resultset('Projects')->search({hidden => 0},{})) {
|
|||
},
|
||||
{ join => 'resultInfo'
|
||||
, order_by => 'id DESC'
|
||||
, rows => 3 # !!! should make this configurable
|
||||
, rows => $keepnr
|
||||
});
|
||||
keepBuild $_ foreach @recentBuilds;
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ create table Jobsets (
|
|||
enableEmail integer not null default 1,
|
||||
hidden integer not null default 0,
|
||||
emailOverride text not null,
|
||||
keepnr integer not null default 3,
|
||||
primary key (project, name),
|
||||
foreign key (project) references Projects(name) on delete cascade on update cascade
|
||||
#ifdef SQLITE
|
||||
|
@ -504,7 +505,6 @@ create index IndexBuildsOnTimestamp on Builds(timestamp);
|
|||
create index IndexBuildsOnJobFinishedId on builds(project, jobset, job, system, finished, id DESC);
|
||||
create index IndexCachedHgInputsOnHash on CachedHgInputs(uri, branch, sha256hash);
|
||||
create index IndexCachedGitInputsOnHash on CachedGitInputs(uri, branch, sha256hash);
|
||||
create index IndexCachedGitInputsOnLastSeen on CachedGitInputs(uri, branch, lastSeen);
|
||||
create index IndexCachedSubversionInputsOnUriRevision on CachedSubversionInputs(uri, revision);
|
||||
create index IndexJobsetEvalMembersOnBuild on JobsetEvalMembers(build);
|
||||
create index IndexJobsetInputAltsOnInput on JobsetInputAlts(project, jobset, input);
|
||||
|
|
Loading…
Reference in a new issue