How can I run a Jenkinsfile from a particular folder

+5 votes

I am new to Jenkins. I am trying to run a Freestyle Jenkins project in which I want to execute a Jenkinsfile from a particular folder. Now, when I run the project the Jenkinsfile is not detected. Path to my Jenkinsfile: /pipelinescript/Jenkinsfile

Mar 27, 2018 in Jenkins by DareDev
• 6,890 points
24,568 views

4 answers to this question.

+2 votes

Consider the below points: The Freestyle project of Jenkins has some trouble calling Jenkinsfile. I would suggest you to select a Pipeline job to use the Jenkinsfile. Here, just give the path to the Jenkinsfile. Consider the below screenshot: 

enter image description here

answered Mar 27, 2018 by anonymous
+1 vote

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"
answered Oct 11, 2018 by lina
• 8,220 points
+1 vote

Try mentioning absolute path to your jenkins file instead of /pipelinescript/Jenkinsfile. Hope this helps as it worked for me.

answered Oct 16, 2018 by Kalgi
• 52,350 points
+1 vote

Try loading using the following syntax

"/<custom path here>/Jenkinsfile"

As when you don't use the "/" before the path it selects the current workspace and loads from it. If you want to select a custom location add the entire path with a slash prefix. 

answered Oct 16, 2018 by lina
• 8,220 points

Related Questions In Jenkins

0 votes
1 answer

I’m facing a login error when I try to run Jenkins on Docker. How do I solve this?

You have to open the /var/log/jenkins/jenkins.log file to ...READ MORE

answered Jul 24, 2018 in Jenkins by Sophie may
• 10,620 points
3,579 views
0 votes
2 answers
0 votes
1 answer

How do I know who has performed a particular operation in jenkins?

You can keep a log of who ...READ MORE

answered May 30, 2019 in Jenkins by Sirajul
• 59,230 points
9,255 views
+4 votes
7 answers

How to set the pipeline name and description for a Jenkinsfile?

You can rename pipeline jobs in jenkins ...READ MORE

answered Oct 11, 2018 in Jenkins by Hannah
• 18,520 points
36,382 views
0 votes
1 answer

How can I create global macros and templates in jenkins job builder?

you can append the path to the ...READ MORE

answered Apr 2, 2018 in Jenkins by ajs3033
• 7,300 points
1,858 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,041 views
+2 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP