Add a jobset eval action to restart all aborted/cancelled builds

This commit is contained in:
Eelco Dolstra
2013-10-04 17:01:47 +02:00
parent 85d51074b9
commit 052bab169d
5 changed files with 52 additions and 37 deletions

View File

@ -163,6 +163,16 @@ sub cancel : Chained('eval') PathPart('cancel') Args(0) {
}
sub restart_aborted : Chained('eval') PathPart('restart-aborted') Args(0) {
my ($self, $c) = @_;
requireProjectOwner($c, $c->stash->{eval}->project);
my $builds = $c->stash->{eval}->builds->search({ finished => 1, buildstatus => { -in => [3, 4] } });
my $n = restartBuilds($c->model('DB')->schema, $builds);
$c->flash->{successMsg} = "$n builds have been restarted.";
$c->res->redirect($c->uri_for($c->controller('JobsetEval')->action_for('view'), $c->req->captures));
}
# Hydra::Base::Controller::NixChannel needs this.
sub nix : Chained('eval') PathPart('channel') CaptureArgs(0) {
my ($self, $c) = @_;