Plugins: Add isEnabled method

Plugins are now disabled at startup time unless there is some relevant
configuration in hydra.conf. This avoids hydra-notify having to do a
lot of redundant work (a lot of plugins did a lot of database queries
*before* deciding they were disabled).

Note: BitBucketStatus users will need to add 'enable_bitbucket_status
= 1' to hydra.conf.
This commit is contained in:
Eelco Dolstra
2019-08-13 17:20:16 +02:00
parent f49a089fc0
commit 16811d3e78
12 changed files with 59 additions and 3 deletions

View File

@@ -5,6 +5,11 @@ use parent 'Hydra::Plugin';
use experimental 'smartmatch';
use JSON;
sub isEnabled {
my ($self) = @_;
return defined $self->{config}->{runcommand};
}
sub configSectionMatches {
my ($name, $project, $jobset, $job) = @_;