Declarative jobsets: move event handling to a plugin
Declarative jobsets were sort of tucked in to the event hanlder itself. It turned out that it could have been implemented as a plugin without much trouble.
This commit is contained in:
parent
9bce425c33
commit
593af41808
17
src/lib/Hydra/Plugin/DeclarativeJobsets.pm
Normal file
17
src/lib/Hydra/Plugin/DeclarativeJobsets.pm
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
package Hydra::Plugin::DeclarativeJobsets;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use parent 'Hydra::Plugin';
|
||||||
|
use Hydra::Helper::AddBuilds;
|
||||||
|
|
||||||
|
sub buildFinished {
|
||||||
|
my ($self, $build, $dependents) = @_;
|
||||||
|
|
||||||
|
my $project = $build->project;
|
||||||
|
my $jobsetName = $build->get_column('jobset');
|
||||||
|
if (length($project->declfile) && $jobsetName eq ".jobsets" && $build->iscurrent) {
|
||||||
|
handleDeclarativeJobsetBuild($self->{"db"}, $project, $build);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
|
@ -49,12 +49,6 @@ sub buildStarted {
|
||||||
sub buildFinished {
|
sub buildFinished {
|
||||||
my ($build, @deps) = @_;
|
my ($build, @deps) = @_;
|
||||||
|
|
||||||
my $project = $build->project;
|
|
||||||
my $jobsetName = $build->get_column('jobset');
|
|
||||||
if (length($project->declfile) && $jobsetName eq ".jobsets" && $build->iscurrent) {
|
|
||||||
handleDeclarativeJobsetBuild($db, $project, $build);
|
|
||||||
}
|
|
||||||
|
|
||||||
my @dependents;
|
my @dependents;
|
||||||
foreach my $id (@deps) {
|
foreach my $id (@deps) {
|
||||||
my $dep = $db->resultset('Builds')->find($id)
|
my $dep = $db->resultset('Builds')->find($id)
|
||||||
|
|
Loading…
Reference in a new issue