How to set the root directory of a workspace on Jenkins subordinates?

By default, jobs on the Jenkins slave will be stored in [Remote FS root]\workspace\ .

Currently [Remote FS root] set to D:\ , so my jobs are in D:\workspace\ . Due to the 255 character limit on Windows, I need my job directories directly in the root of the drive.

How to set the root directory of a workspace to D:\ ?

+7
continuous-integration jenkins
source share
2 answers

We must specify the following argument when starting the Jenkins node wizard:

 -Dhudson.model.Slave.workspaceRoot=D:/ 

To do this, find the jenkins.xml configuration file in $JENKINS_HOME and fill out the <arguments></arguments> section.

+6
source share

By default, jobs on a Jenkins slave will be stored in [Remote FS root] \ workspace \

It seems that, at least on Windows, this is actually not the case.

I am running Jenkins 1.480.3, and my slaves are running through jenkins-slave.exe and jenkins-slave.xml on Windows hosts.

Neither the XML file nor the service parameters store any path information, and * a workspace directory is created at the location of jenkins-slave.exe , which matches the parameter in http://server/jenkins/computer/node_name/configureRemote FS root Help for which it reads:

The slave must have a directory dedicated to Jenkins. Specify the absolute path of this working directory on the slave, for example '/ var / jenkins' or 'c: \ jenkins'. It must be a path local to the slave machine. (...)

Slaves do not support important data (except for active workspaces projects that were built on it), so you can set the slave of the workspace to a temporary directory. The only drawback to this is that you may lose your current workspace if the slave is disabled.

Thus, it is actually possible to install a workspace on a slave using the Jenkins FS root for slaves.

Also linked: https://issues.jenkins-ci.org/browse/JENKINS-12667

+2
source share

All Articles