Reputation: 93
I'm working on a job(say Job A) that has a file as a parameter. However, it triggers another job(say Job B) which restricts its execution on a remote machine(slave04) with a custom workspace /home/jobB/workspace
.
Now I tried using ticking Copy files into the job's workspace before building in the Build Environment of Job B and selected custom relative path which is "/" in the option Paths are relative to.
There is the console output of copying process when I print the contents of present working directory (ls -al
) of job B which is /home/jobB/workspace
the file which is supposed to be copied is not there. Console output is here.
[copy-to-slave] Copying 'var/work/jenkins_workspace/jobA/package.zip', excluding nothing, from 'file:/' on the master to 'file:/home/jobB/workspace/' on 'slave04'.
Was my step correct? What should be the correct input in the field Files to copy? Are filenames(package.zip) and file path(var/work/package.zip) both valid? And what does Paths are relative to mean? In my case, I provided an additional option which is "/" in Manage Jenkins->Configure Settings->Copy to slave, so is it right that every path starting with /whateverpath is already relative to that option?
Upvotes: 2
Views: 10001
Reputation: 93
I have successfully copied uploaded file parameter from master job to slave job workspace.
Procedure that didn't work:
var/work/jenkins_workspace/jobA/package.zip
in the Files to copy and chose Paths are relative to /(root)Procedure that worked:
In Manage Jenkins->Configure Settings->Copy to slave I added a Paths are relative to option which is /var/work/jenkins_workspace/jobA
In slave job Build Environment configuration, I provided filename such as /package.zip
in the Files to copy and chose Paths are relative to /var/work/jenkins_workspace/jobA.
Result: File is copied.
So I guess, filepath is not valid in Files to copy field.
Upvotes: 3