Reputation: 9
I have created new jenkins job, in which I want to execute a Jenkins file from a particular folder.
I have created one folder in my project named pipelinescript
, in which I have placed my Jenkinsfile
.
But when I am executing that job the file has not been detected.
In script path I have also give /pipelinescript/Jenkinsfile
, but it is not working.
Upvotes: 1
Views: 5071
Reputation: 1553
A few things to consider:
Upvotes: 1
Reputation: 2018
First of all jenkins whichever files are picking up, all are workspace related. If you refer a path with no /
in front of it, then it will load it from workspace
only. To load a jenkins file from a custom location, you have to do like this by adding this line to the script.
load "/<custom path here>/Jenkinsfile"
For more info, please refer this.
Upvotes: 0
Reputation: 88
Instead of mentioning /pipelinescript/Jenkinsfile please use the entire absolute path. It will resolve the issue.
Upvotes: 0