Allow passing a specific build as an input

Fixes #62.
This commit is contained in:
Eelco Dolstra
2013-11-11 21:36:26 +00:00
parent 8f104396ec
commit dd4e57fb0c
3 changed files with 20 additions and 11 deletions

View File

@ -175,14 +175,17 @@ sub nixExprPathFromParams {
sub checkInputValue {
my ($c, $name, $type, $value) = @_;
$value = trim $value;
error($c, "The value $value of input $name is not a Boolean (true or false).") if
$type eq "boolean" && !($value eq "true" || $value eq "false");
error($c, "The value $value of input $name does not specify a Hydra evaluation. "
. "It should be either the number of a specific evaluation, the name of "
. "a jobset (given as <project>:<jobset>), or the name of a job (<project>:<jobset>:<job>).")
if $type eq "eval" && $value !~ /^\d+$/
&& $value !~ /^$projectNameRE:$jobsetNameRE$/
&& $value !~ /^$projectNameRE:$jobsetNameRE:$jobNameRE$/;
return $value;
}

View File

@ -36,8 +36,8 @@ sub begin :Private {
'string' => 'String value',
'boolean' => 'Boolean',
'nix' => 'Nix expression',
'build' => 'Build output',
'sysbuild' => 'Build output (same system)',
'build' => 'Previous Hydra build',
'sysbuild' => 'Previous Hydra build (same system)',
'eval' => 'Previous Hydra evaluation'
};
$_->supportedInputTypes($c->stash->{inputTypes}) foreach @{$c->hydra_plugins};