Return value from Groovy script is treated as Label Expression. It is treated as followings:
Following variables are binded, but there may be cases that some type of parameters are not set, or set to wrong value. This is for a build is not started yet when this Groovy script is evaluated.
Here is an example:
Example1-----------------------------------------------------------------------------
// parameters defined in "This build is parameterized" are binded,
// and you can use them just as variables.
if(is_test == "true")
{
// use nodes labeled "debug_node"
return "debug_node";
}
// returning blank value does not restrict nodes.
// When restricted with other parameters or plugins, that configuration will be used.
return null;
Example2-----------------------------------------------------------------------------
// Values defined with axe with a matrix project are also binded.
// But that value is not defined in a root matrix build,
// so access with binding.getVariables().get(VARNAME) .
// (accessing VARNAME directly results exceptions)
switch(binding.getVariables().get("target"))
{
case "Win32":
case "Win64":
// run on Windows.
return "Windows";
case "Linux32":
case "Linux64":
// run on Linux.
return "Linux";
}