0

I had given remote root directory as C:\jenkins for my jeknins slave but my robot framework actually work in D:\automation and place results there and when i try to execute single build steps it actualluy works on C:\jenkins\workspace\Job_name can anyone tell me how to make jenkins slave work in this D:\automation , i had actually tried giviing

Hello
  • 17
  • 7
  • duplicate of https://stackoverflow.com/questions/23780554/how-to-set-the-workspace-root-directory-on-jenkins-slaves – Stefan Drissen Nov 19 '19 at 05:57
  • That [duplicate](https://stackoverflow.com/q/23780554/598141) is very old (2014), as is [this](https://stackoverflow.com/q/30223282/598141) and [this](https://stackoverflow.com/q/46588929/598141). While probably all still valid, they correspond to the Jenkins 1.x era and there are more options now in 2.x – Ian W Nov 19 '19 at 07:04

2 Answers2

2

This can be configured individually on each node, overriding the default location.

Node Level:
Under Jenkins | Manage Jenkins | Manage Nodes ...
< pick your node > | Configure
Remote root directory [D:\path\of\choice]

Job Level:
You can also change the workspace of an individual job under
General | Advanced ...

[ X ] Use custom workspace
Directory [D:\path\of\choice]

System Level:
There is also the Jenkins System Properties override:
hudson.model.Slave.workspaceRoot [ workspace ]
name of the folder within the slave root directory to contain workspaces


And for completeness, even though it's a bad idea to run jobs on the master:

Master Specific system property:
jenkins.model.Jenkins.workspacesDir [ ${JENKINS_HOME}/workspace/${ITEM_FULL_NAME} ]
Allows to change the directory layout for the job workspaces on the master node.

See jenkins.model.Jenkins.buildsDir for supported placeholders.

Ian W
  • 4,559
  • 2
  • 18
  • 37
-1

Well as described by @Ian W, Node level configurations can help you define your custom location in the Slave(Node). Make sure your Jenkins slave user has permissions on the folder.

Anil Kumar
  • 516
  • 2
  • 6
  • 16