B:BD[
2.1149] → [
2.1149:1610]
# For finished builds, we only keep the output path, not the derivation.
foreach my $build ($db->resultset('Builds')->search({finished => 1, buildStatus => 0}, {join => 'resultInfo'})) {
if ($build->resultInfo->keep || defined $pathsToKeep{$build->outpath}) {
if (isValidPath($build->outpath)) {
registerRoot $build->outpath;
} else {
print STDERR "warning: output ", $build->outpath, " has disappeared\n";
}
foreach my $project ($db->resultset('Projects')->all) {
foreach my $job ($project->builds->search({},
{select => [{distinct => 'attrname'}], as => ['attrname']}))
{
print "*** looking for builds to keep in ", $project->name, ":", $job->attrname, "\n";
# Keep the N most recent successful builds for each job and
# platform.
my @recentBuilds = $project->builds->search(
{ attrname => $job->attrname
, finished => 1
, buildStatus => 0 # == success
},
{ join => 'resultInfo'
, order_by => 'timestamp DESC'
, rows => 3 # !!! should make this configurable
});
keepBuild $_ foreach @recentBuilds;