Allow for precisely one instance of RunCommand plugin

[?]
Aug 21, 2018, 2:51 PM
OAGCZHK6XBVVEY7BX23CKWIZLG2WUH3J6B5BCHNOXMNDUIUWK7OAC

Dependencies

  • [2] 6ZXL5UOP Add a plugin to execute arbitrary commands when a build finishes
  • [3] GD2WBYPT RunCommand: Return metrics as a float

Change contents

  • replacement in src/lib/Hydra/Plugin/RunCommand.pm at line 28
    [2.601][2.601:694]()
    my ($cfg, $event) = @_;
    for my $x (split " ", ($cfg->{events} // "buildFinished")) {
    [2.601]
    [2.694]
    my ($conf, $event) = @_;
    for my $x (split " ", ($conf->{events} // "buildFinished")) {
  • replacement in src/lib/Hydra/Plugin/RunCommand.pm at line 39
    [2.847][2.847:901]()
    my $config = $self->{config}->{runcommand} // [];
    [2.847]
    [2.901]
    my $cfg = $self->{config}->{runcommand};
    my @config = defined $cfg ? ref $cfg eq "ARRAY" ? @$cfg : ($cfg) : ();
  • replacement in src/lib/Hydra/Plugin/RunCommand.pm at line 44
    [2.916][2.916:997]()
    foreach my $cfg (@$config) {
    next unless eventMatches($cfg, $event);
    [2.916]
    [2.997]
    foreach my $conf (@config) {
    next unless eventMatches($conf, $event);
  • replacement in src/lib/Hydra/Plugin/RunCommand.pm at line 47
    [2.1039][2.1039:1075]()
    $cfg->{job} // "*:*:*",
    [2.1039]
    [2.1075]
    $conf->{job} // "*:*:*",
  • replacement in src/lib/Hydra/Plugin/RunCommand.pm at line 52
    [2.1201][2.1201:1295]()
    my $command = $cfg->{command} // die "<runcommand> section lacks a 'command' option";
    [2.1201]
    [2.1295]
    my $command = $conf->{command} // die "<runcommand> section lacks a 'command' option";