Jenkins: Multiple Git repositories for one project Jenkins: Multiple Git repositories for one project jenkins jenkins

Jenkins: Multiple Git repositories for one project


UPDATE

Multiple SCMs Plugin is now deprecated so users should migrate to Pipeline plugin.

Old answer

Yes, Jenkins can handle this. Just use Multiple SCMs under Source Code Management, add your repositories and then go to the Advanced section of each repository. Here you need to set Local subdirectory for repo (optional) and Unique SCM name (optional).

Your repository will be pulled to the Local subdirectory which you have set so then you can build them in any order you want.

Updating per harishs answer - you need to install Multiple SCMs Plugin in order to achieve this functionality.


Answer from Petr Mensik is right but this does not seem to be available by default in Jenkins. One needs to install Multiple SCM plugin to get this feature: https://wiki.jenkins-ci.org/display/JENKINS/Multiple+SCMs+Plugin


I had the same question, when I looked at the Multiple SCM plugin answer I noticed this plugin is now listed as deprecated. There is a notice that recommends to use a pipeline for this.

Below is a sample config of how I managed to do this with a pipeline.

node() {  stage ('Extract') {    parallel 'Extract':{      dir('project1') {        git url: 'ssh://git@githost/project1.git'      }      dir('project2') {        git url: 'ssh://git@githost/project2.git'      }    }     }}