Jenkins: Change Workspaces and Build Directory Locations
转自: http://ingorichter.blogspot.jp/2012/02/jenkins-change-workspaces-and-build.html
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 AdvancedButton on the right hand side. Voilà! This opens up the following options section 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
.