Support revision control systems via plugins

This commit is contained in:
Eelco Dolstra
2013-05-25 15:36:58 -04:00
parent 5e0542d3af
commit 1f1615e80b
15 changed files with 588 additions and 513 deletions

View File

@ -3,6 +3,7 @@
use strict;
use feature 'switch';
use Hydra::Schema;
use Hydra::Plugin;
use Hydra::Helper::Nix;
use Hydra::Helper::AddBuilds;
use Hydra::Model::DB;
@ -20,6 +21,8 @@ STDOUT->autoflush();
my $db = Hydra::Model::DB->new();
my $config = getHydraConfig();
my $plugins = [Hydra::Plugin->plugins(db => $db, config => $config)];
# Don't check a jobset more than once every five minutes.
my $minCheckInterval = 5 * 60;
@ -29,10 +32,8 @@ sub fetchInputs {
my ($project, $jobset, $inputInfo) = @_;
foreach my $input ($jobset->jobsetinputs->all) {
foreach my $alt ($input->jobsetinputalts->all) {
my @info = fetchInput($db, $project, $jobset, $input->name, $input->type, $alt->value);
foreach my $info_el (@info) {
push @{$$inputInfo{$input->name}}, $info_el if defined $info_el;
}
push @{$$inputInfo{$input->name}}, $_
foreach fetchInput($plugins, $db, $project, $jobset, $input->name, $input->type, $alt->value);
}
}
}