prevents the build output from being garbage collected.
NEWDDAOFCDLYBXQCZNQ2GDH7HPAHVN3YRDL52ZYEMVA4YH6LBDXAC
3E6IP3R3JGH76PNGG7RCADV65KOV24HQXPXNLVVYIQ46AVYJRG3AC
ZILILXXKP4Z64UGIXIPTQ3KXPV76LFGSXVFLMLCO2HJBCQ5GP6AQC
LBNVQXUBEZ45SOTGVXK5UEZXIAIZTJLWZNUYFI4JZ6J65N3KPDVQC
A52HEFHQNVNF2OUSWDSUYVVXLYR2UFCGOORPCN27CJJYA4UDJA3AC
J5UVLXOK6EDIL5I7VKWH4V2QDS4DPD7FHRK6XBWSXFRQS4JKXFZQC
4X6NS66QDWR4S4ZZFKN2QOJQII5ZYIMTDYRHK25N6NJSROVLHJ6QC
WZ3AEJ67LOG5L335AAC2BDLIJPIU4VSCGBMATBHDZC26ECRS5A6AC
IN272KZWHENW2TCR3LWQ6OZAEESJL5S7AEL3GYLJTWHJUDE6HADAC
2T42QGZDK23C5V4ZHO4R7EBJESIQ62GKWDBWVX7OBEE3YVBUNUFAC
$c->res->redirect($c->uri_for($self->action_for("view_build"), $c->req->captures));
}
sub keep : Chained('build') PathPart Args(1) {
my ($self, $c, $newStatus) = @_;
my $build = $c->stash->{build};
requireProjectOwner($c, $build->project);
die unless $newStatus == 0 || $newStatus == 1;
$c->model('DB')->schema->txn_do(sub {
$build->resultInfo->update({keep => int $newStatus});
});
$c->flash->{buildMsg} =
$newStatus == 0 ? "Build will not be kept." : "Build will be kept.";
</tr>
[% END %]
[% IF build.finished && build.buildproducts %]
<tr>
<th>Availability:</th>
<td>
[% IF !available %]
<em>Build output is no longer available</em>
[% ELSIF build.resultInfo.keep %]
<em>Build output will be kept permanently</em>
[% IF c.user_exists %]
<form action="[% c.uri_for('/build' build.id 'keep' 0) %]" method="post" class="inline">
<button id="unkeep" type="submit">Unkeep</button>
</form>
[% END %]
[% ELSE %]
<em>Build output is available, but may be garbage-collected</em>
[% IF c.user_exists %]
<form action="[% c.uri_for('/build' build.id 'keep' 1) %]" method="post" class="inline">
<button id="keep" type="submit">Keep</button>
</form>
[% END %]
[% END %]
</td>
foreach my $job ($project->builds->search({},
{select => [{distinct => 'job'}], as => ['job']}))
{
print "*** looking for builds to keep in job ", $project->name, ":", $job->job, "\n";
foreach my $job ($project->jobs->all) {
print STDERR "*** looking for builds to keep in job ",
$project->name, ":", $job->jobset->name, ":", $job->name, "\n";
my @recentBuilds = $project->builds->search(
{ job => $job->job
, finished => 1
# !!! Take time into account? E.g. don't delete builds that
# are younger than N days.
my @recentBuilds = $job->builds->search(
{ finished => 1