![]() |
Advanced Project Options |
Once you opened the settings, you will find some more configuration options for your job. Look for the “Use custom workspace” option on the right hand side and check the box.
![]() |
Specify custom workspace for job |
Here is some information that you should consider reading, prior to change the workspace.
![]() |
Information about custom workspace |
Important: The next build will use the new location, but you have to manually relocate all the existing content from the previous location.
Globally Changing the workspace location for all Jobs
In order of changing the workspace for a single job, there is another option in the Jenkins system settings that allows for changing the workspace for every job.Navigate to Jenkins->Manage Jenkins->Configure System and click on the Advanced Button on the right hand side.
![]() |
Specify custom workspace and builds directory location |
Voilà! This opens up the following options section
![]() |
Custom workspace and builds directory location |
Now you can change your workspace and build directory to any other location on your machine. Jenkins provides 3 predefined variables that can be used to specify the new location:
- ${JENKINS_HOME} — Jenkins home directory
- ${ITEM_ROOTDIR} — Root directory of a job for which the workspace is allocated
- ${ITEM_FULLNAME} — ‘/’-separated job name, like “foo/bar”
${ITEM_ROOTDIR}/workspace
and for the “Build Record Root Directory” it’s ${ITEM_ROOTDIR}/builds
.Some Notes
Please be aware, that if you change your workspace to a different location, the contents of the “old” workspace directory are not copied over to the new workspace.Doing this on OSX could require to change the owner of the newly created workspace. So, if you encounter permission issues during your next build, then have a look at the new location.
17 comments:
I didn't know pointing to a new workspace would be so easy! I should've guessed because everything in Jenkins is pretty slick. And this blog gave me the courage to charge ahead without caution.
Great to hear that this was helpful to you.
TL;DR use ITEM_FULL_NAME instead of ITEM_FULLNAME.
I had some trouble with this on Windows because the build job was a Maven project and ITEM_FULLNAME was expanding to a path with a component named "groupId:artifactId", which Windows rejected (due to the illegal colon character).
Found this issue, the comments of which were helpful: https://issues.jenkins-ci.org/browse/JENKINS-12251.
The advice is to use ITEM_FULL_NAME instead of ITEM_FULLNAME.
After changing the workspace and build directories, using the Jenkins interface, my jobs are not starting anymore. They stay in pending state, with message "pending - waiting for next executor". I tried to revert the change to the default value; but it doesn't work. I verified that the number of executors didn't change: it's still 2, like it used to be. I am using Windows; and after changing the configuration, Jenkins created automatically those directories, with links to the previous ones. Can anybody help me with this?
I managed to resolve the problem using the Jenkins web interface, by doing the following:
1 Going to the Jenkins configuration and clicking on the button "Reload configuration from disk";
2 Going to the build executor status page; I noticed that the master was in "dead" state; I clicked on its name and it changed to Idle
I am not sure which of the two things resolved the problem; but the problem definitely happened after I changed the configuration.
I m archiving my builds . is there anyway i can change the location for it ?
Does anyone know if it is possible to have the Jenkins access its jobs if they're stored in an aws s3 bucket?
I don't know if there is a way to specify the archive location. Have you had a look at the sources?
I don't think, that there is a way to access the Jenkins job when they are located in S3. Usually jobs have to be located on the local Jenkins install directory.
Nice and helpful blog. Thanks for sharing this valuable knowledge Business Directory Listing India, Local Business Listing.
What does this ${ITEM_ROOTDIR}/workspace indicate?I just want to know where this ${ITEM_ROOTDIR}/workspace point outs to specifically.
Nice Blog,Thanks For Sharing Information.
ABCWorld is Business Centre in Pune Providing fully-furnished and equipped workspace in Pune & commercial office space in pune .
ABCWorld is Business Centre in Pune Providing fully-furnished and equipped workspace in Pune & commercial office space in pune .
Thanks for sharing Good informative blog post on Jenkins. This helpful to me alot and hope the same for jenkins learner.
Best Regards,
DevOps Training in Hyderabad
Apeejay Business Center is coworking space Providing fully-furnished and equipped coworking space pune & coworking .
Being One of prestigious office space for rent in Pune , Apeejay Business Center offers spacious and ergonomically designed executive office space providers and office space on rent in pune.
Thanks for Hints,
!!! BUT !!
After I followed the instructions and run again the Jenkins I loosed all my Files and Dirs in the custom location.
later I found the following in text:
Important: The next build will use the new location, but you have to manually relocate all the existing content from the previous location.
Please put it at the start of the instructor to avoid such situation.
Now my Question is do someone knows how to get the loosed content from the Custom location?
Being One of prestigious office space for rent in Pune , Apeejay Business Center offers spacious and ergonomically designed executive office space providers and office space on rent in pune.
Post a Comment