Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins(Hudson) SVN checkout dir

In Jenkins (Hudson) how do i change the checkout location of a project.

I want the project to be checked out to the doc-root of apache2 which is at /var/svn/project by default Jenkins checks it out to the /jobs dir on /lib/jenkins/

I thought of running a shell command to copy the checked out code from jobs folder to the doc-root but it'll copy the entire folder even if its a single file that has been changed.

Should i look in to rsync or can Jenkins do this (even with a plugin)

like image 794
heshanh Avatar asked Aug 31 '11 03:08

heshanh


2 Answers

There is an option in Jenkins to change the location of your workspace...

On the job configuration page, under the section "Advanced Project Options", click the "Advanced" button.

Check the box near "Use custom workspace", and fill in the location where you want your check-out to go.

like image 62
Sagar Avatar answered Nov 03 '22 11:11

Sagar


There is no option for this in the Jenkins SVN plugin. I was, however, able to achieve it on Windows with a directory Junction Link - and you could do the same on a *nix installation with a symbolic link.

Specifically, I cd'ed into the Jenkins job/myjob/workspace directory and did this

mklink /J junction_to_working_copy c:\my\real\working\copy

then in the Subversion configuration of the Jenkins project (under Source Code Management) for the "Local module directory (optional)" field I entered:

junction_to_working_copy

This does the trick well enough

like image 21
Rhubarb Avatar answered Nov 03 '22 11:11

Rhubarb