Lee Cordell
Lee Cordell

Reputation: 276

Unable to set Workspace Root Directory on Jenkins master on Windows

I need to set my workspace root directory to another location to save space on the C drive. I am able to change the configuration in the 'workspace root directory' field in Manage Jenkins / Configuration but this is not reflected in my builds.

I've tried restarting the windows service, rebooting etc. I've also tried as previous posts suggested building from the 'workspace' page for affected projects to no avail.

I've tried setting the workspace root directory to: D:/Jenkins/workspace/ D:\Jenkins\workspace D:/Jenkins/workspace/${ITEM_FULLNAME}

However, builds are still trying to use the default workspace as seen by the console output: "Started by user anonymous Building on master in workspace C:\Program Files (x86)\Jenkins\workspace\xxxx\xxxxx"

I have tried clearing workspaces of failing jobs and building from the 'workspace' page for those jobs - this didn't help.

Upvotes: 2

Views: 7869

Answers (3)

Lee Cordell
Lee Cordell

Reputation: 276

I found the issue. There was a custom workspace set for each job in the dev server that I inherited. The custom workspace was a relative path (\jobname...) but it was appending the relative path to the 'Home Directory' as opposed to the 'Workspace Root Directory'. I had assumed wrongly that the custom workspace path would be relative to the workspace root directory.

Upvotes: 2

klerk
klerk

Reputation: 371

  • Remove slave from the Jenkins master (delete and save config somewhere)
  • Delete the workspace on the Windows machine and delete the service if it is installed as a service with sc delete <service name> from cmd
  • reconnect the slave with new FS root

Upvotes: 0

DevD
DevD

Reputation: 664

you can change it in jenkins config .xml and restart the service.

if you want same workspace for all the jobs then you can use customized workspace which is available in advanced tab.

Upvotes: 0

Related Questions