简体   繁体   中英

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

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?

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.

Workaorund:使用触发器作业来轮询SVN,进行结账,并通过参数化触发器插件启动主要工作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM