Howto define 2 Jenkins jobs on ONE PROJECT, with 2 different versions on 2 different GIT repositories

12 views
Skip to first unread message

Sylvain Richet

unread,
Feb 3, 2015, 10:24:54 AM2/3/15
to jenkins...@googlegroups.com
Hi Guys,

First time i need this (temporarily) :
having 2 Jenkins jobs mapping the same project (say: "myproject"), but on 2 differents GIT repositories :

- "myproject" on Bitbucket
- "myproject" on Github

My projects are all "mavenized", with inner modules and relative paths :
[...]
<modules>
        <module>../module1</module>
        <module>../module2</module>
</modules>
[...]

By default, checkout/fetch/clone products are written in : /var/lib/jenkins/workspace
But :
1) with the same project name, I have to rename one of the 2 jobs. So: ~OK
2) the same relative paths in both projects

So, i tried to trick around :
[job] >>  Source Code Management >> Additional Behaviours >> Check out to a sub-directory >> Local subdirectory for repo
- "myproject" on Bitbucket ==> bitbucket-projects
- "myproject" on Github ==> github-projects

But it is relative to "workspace root", which is : /var/lib/jenkins/workspace/myproject
... and not : /var/lib/jenkins/workspace !

I wanted to have both:
/var/lib/jenkins/workspace/bitbucket-projects/myproject
/var/lib/jenkins/workspace/github-projects/myproject

... but i get :
/var/lib/jenkins/workspace/myproject/bitbucket-projects/....
/var/lib/jenkins/workspace/myproject/github-projects/....

So it does not fit !

# The real question is finally :
HOW TO CHANGE/CONFIGURE THE OVERALL JENKINS WORKSPACE (default : /var/lib/jenkins/workspace) AT JOB LEVEL ?


Any idea ?
Thx a lot in advance

Regards

Sylvain Richet

unread,
Feb 3, 2015, 12:11:11 PM2/3/15
to jenkins...@googlegroups.com
(auto-response)

Just using :
[job] >> build >> Advanced >> Use custom workspace... with something like :
/var/lib/jenkins/workspace/github-projects/${POM_ARTIFACTID}

It works great !
Reply all
Reply to author
Forward
0 new messages