diff --git a/src/lib/Hydra/Plugin/DeclarativeJobsets.pm b/src/lib/Hydra/Plugin/DeclarativeJobsets.pm new file mode 100644 index 00000000..2b6771b5 --- /dev/null +++ b/src/lib/Hydra/Plugin/DeclarativeJobsets.pm @@ -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; diff --git a/src/script/hydra-notify b/src/script/hydra-notify index 22e027ba..1c696cac 100755 --- a/src/script/hydra-notify +++ b/src/script/hydra-notify @@ -53,12 +53,6 @@ sub buildFinished { my $build = $db->resultset('Builds')->find($buildId) or die "build $buildId does not exist\n"; - 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; foreach my $id (@deps) { my $dep = $db->resultset('Builds')->find($id)