Jenkins – How to prevent Jenkins from SVN checkout to workspace folder while using multi-configuration jobs

Jenkinssvn

I have configured a job in Jenkins using the multi-configuration project option.
I am able to build the user defined axis targets successfully, but find that Jenkins first starts checking out in the workspace folder (which isn't actually used) and checks out the same in a workspace/target folder in which the build for that target is actually executed.

So, when a build is triggered, Jenkins first checks out the given URL to workspace/ and then to workspace/target/ etc.

Actual steps:

1. checkout to workspace
2. checkout to workspace/target/<target1>
3. checkout to workspace/target/<target2>

Expected steps:

1. checkout to workspace/target/<target1>
2. checkout to workspace/target/<target2>

How can I prevent Jenkins from doing the first checkout and only do the relevant ones?

Or even better, my builds permit doing them all in a single checkout. Can I do that?

Best Answer

The problem is that Jenkins uses a parent job which spawn jobs for each target. Unfortunately it also does a checkout to the jobs workspace.

If you are running these target specific jobs on different slaves/machines you can set the target checkout directory to be the same as the parent workspace directory. So effectively sharing the workspace on that node instead of duplicating it.

In the Advanced Project Options section, click the Advanced button to expand the section. Check Use custom workspace and use "." for the Directory for sub-builds. If not specified it defaults to something like /target/<target1>

Now instead of checking out to workspace/target/<target1> it will only checkout to workspace/ on the different targets.

Related Topic