Add buildQueued plugin hook
This commit is contained in:
parent
3d044d2ec2
commit
582c399420
|
@ -20,6 +20,11 @@ sub instantiate {
|
|||
return @$plugins;
|
||||
}
|
||||
|
||||
# Called when build $build has been queued.
|
||||
sub buildQueued {
|
||||
my ($self, $build) = @_;
|
||||
}
|
||||
|
||||
# Called when build $build has started.
|
||||
sub buildStarted {
|
||||
my ($self, $build) = @_;
|
||||
|
|
|
@ -69,6 +69,10 @@ sub common {
|
|||
}
|
||||
}
|
||||
|
||||
sub buildQueued {
|
||||
common(@_, [], 0);
|
||||
}
|
||||
|
||||
sub buildStarted {
|
||||
common(@_, [], 0);
|
||||
}
|
||||
|
|
|
@ -471,6 +471,7 @@ sub checkBuild {
|
|||
print STDERR "added build ${\$build->id} (${\$jobset->project->name}:${\$jobset->name}:$jobName)\n";
|
||||
});
|
||||
|
||||
system("hydra-notify build-queued " . $build->id) if defined $buildMap->{$build->id} && $buildMap->{$build->id}->{new};
|
||||
return $build;
|
||||
};
|
||||
|
||||
|
|
|
@ -42,6 +42,15 @@ if ($cmd eq "build-finished") {
|
|||
}
|
||||
}
|
||||
|
||||
elsif ($cmd eq "build-queued") {
|
||||
foreach my $plugin (@plugins) {
|
||||
eval { $plugin->buildQueued($build); };
|
||||
if ($@) {
|
||||
print STDERR "$plugin->buildQueued: $@\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
elsif ($cmd eq "build-started") {
|
||||
foreach my $plugin (@plugins) {
|
||||
eval { $plugin->buildStarted($build); };
|
||||
|
|
Loading…
Reference in a new issue