hydra-notify: Create a helper for running each plugin on an event

This commit is contained in:
Graham Christensen 2021-08-12 12:53:58 -04:00 committed by Your Name
parent d02c6794f4
commit 10e85e3422

View file

@ -31,6 +31,19 @@ $listener->subscribe("build_started");
$listener->subscribe("build_finished"); $listener->subscribe("build_finished");
$listener->subscribe("step_finished"); $listener->subscribe("step_finished");
sub runPluginsForEvent {
my ($event) = @_;
foreach my $plugin (@plugins) {
eval {
$event->execute($db, $plugin);
1;
} or do {
print STDERR "error running $event->{'channel_name'} hooks: $@\n";
}
}
}
sub buildStarted { sub buildStarted {
my ($buildId) = @_; my ($buildId) = @_;