Add a plugin mechanism
You can now add plugins to Hydra by writing a module called Hydra::Plugin::<whatever> and putting it in Perl's search path. The only plugin operation currently supported in buildFinished, called when hydra-build has finished doing a build. For instance, a Twitter notification plugin would look like this: package Hydra::Plugin::TwitterNotification; sub buildFinished { my ($self, $db, $config, $build, $dependents) = @_; print STDERR "tweeting about build ", $build->id, "\n"; # send tweet... } 1;
This commit is contained in:
14
src/lib/Hydra/Plugin.pm
Normal file
14
src/lib/Hydra/Plugin.pm
Normal file
@ -0,0 +1,14 @@
|
||||
package Hydra::Plugin;
|
||||
|
||||
use Module::Pluggable
|
||||
search_path => "Hydra::Plugin",
|
||||
require => 1;
|
||||
|
||||
# $plugin->buildFinished($db, $config, $build, $dependents):
|
||||
#
|
||||
# Called when build $build has finished. If the build failed, then
|
||||
# $dependents is an array ref to a list of builds that have also
|
||||
# failed as a result (i.e. because they depend on $build or a failed
|
||||
# dependeny of $build).
|
||||
|
||||
1;
|
Reference in New Issue
Block a user