5
votes

I am trying to configure a jenkins server for build processes. My directory structure is as follows

/home/<user>/projects/MyProject
/home/<user>/projects/MyProject/scripts
/home/<user>/projects/MyProject/trunk

I have given the path upto scrips for custom workspace in jenkins i.e. /home/<user>/projects/MyProject/scripts now I want to checkout the project from SVN trunk to my local trunk. When I am giving path to trunk (/home/<user>/projects/MyProject/trunk) for the local checkout directory (where the project should be checked out), jenkins is showing me that "absolute path is not allowed". How can I give the path upto trunk for svn checkouts by jenkins.

I have spent hours for searching a solution for that i.e. jenkins doc, jenkins forum, hudson docs, hudson forum and here on SO, but couldnt find a solution for this. Please help..

1
just noticed this was my 100th question on SO.. Thanks SO for teaching me so many things.Amit
This is a known issue of jenkins... However they say it is resolved but I am yet to find a solution for thisAmit

1 Answers

1
votes

For various (and reasonable) reasons, each Jenkins job has its own unique workspace. The best practice is to use relative (rather than absolute) paths, and do your builds under the default workspace folder generated by Jenkins.

However, sometimes when dealing with legacy code, paths are hard-coded into build scripts and are difficult to change. In this case, you can use a custom workspace for this build:

  • In a pipeline job, use the ws('/home/<user>/projects/MyProject') { ... } step.
  • In a freestyle job, click the "Advanced" button and check the "Use custom workspace" checkbox, then specify your custom path.