I want to execute a groovy script step inside a subdirectory of a configs working directory. How can i do this? for the buildscript step I see options to provide the build scritp path which can be different that the working directory. I want to do something like that with Execute Script step.
This is what i wanna do
groovy:
def sRootDir = configuration.workspaceDir.absolutePath + '/' + vars.getValue("ProjectPath") + '/TestScripts/';
def sPythonExe = configuration.workspaceDir.absolutePath + '/' + vars.getValue("ProjectPath") + '/Tools/Python/python.exe';
def generateScriptCmd = '"' + sPythonExe + '" GenerateScript.py';
def proc1 = generateScriptCmd.execute();
proc1.waitFor();
I want generateScriptCmd to be executed inside sRootDir and not configuration.workspaceDir.absolutePath. If this was a batch script i would use pushd and popd but i dont know how to do it in a groovy script.
ok i was able to get it to work doing so
def proc1 = generateScriptCmd.execute(null, new File(sRootDir));