I have a Jenkins parent groovy file which consumes the child groovy file
Parent grooy file:
...
def child = load 'child-groovy-file';
child.execute();
Child groovy file:
a = "first letter";
b = "second letter;
def execute
{
echo "a is "+a;
...
}
But this is not working. Unable to access variables, which are defined in Child Groovy file, when trying to access from Parent groovy file. When I create a node block and trying to consume directly the child groovy file, It is working.
Is the Environment variables only the solution to access globally?