I am using below Groovy script to check existence of files and changing the variable from false to true, but noticed that it's still printing as false even after setting it with vars.get("myTestVar").setValue() method. Am I missing anything?
The variable is used another step in the same configuration and it's not getting triggered since 'myTestVar' is always false, irrespective of the code below.
We are on Quickbuild version 6.1.9.
groovy:
import static groovy.io.FileType.FILES;
import com.pmease.quickbuild.Context;
Context.getLogger().info("myTestVar value:" + "${vars.getValue("myTestVar")}");
new File('/opt/myData/abc').eachFileRecurse(FILES) {
if(it.name.startsWith('XYZ')) {
vars.get("myTestVar").setValue(true);
Context.getLogger().info("myTestVar again:" + "${vars.getValue("myTestVar")}");
} else {
vars.get("myTestVar").setValue(false);
}
}