I have a Build Flow project that has a DSL script to configure the flow.
This is my script:
def envVars = build.getEnvironment(listener)
def revision = envVars.get("GIT_COMMIT")
def workspace = envVars.get("WORKSPACE")
println "env vars: " + envVars
println "workspace: " + workspace
println "revision: " + revision
def command = workspace+"""/scripts/my_script.sh"""
def proc = command.execute()
proc.waitFor()
println "return code: ${proc.exitValue()}"
println "stderr: ${proc.err.text}"
println "stdout: ${proc.in.text}"
parallel (
{
build("job1", git_branch: revision)
},
{
build("job2", git_branch: revision)
},
{
build("job3", git_branch: revision)
}
)
In my job configuration I have checked the Restrict where this project can be run
and gave the correct slave label.
My job fails with the following error:
ERROR: Failed to run DSL Script
java.io.IOException:
Cannot run program "/home/jenkins/workspace/my-flow-job/scripts/my_script.sh":
error=2, No such file or directory
i have found out that the DSL script is running on the master node instead of the slave node.
How can i run the DSL on the slave? (or at least execute the script on the slave)
Thanks