Checkout Multiple repos in one Jenkins Workspace - saviovettoor/DevOps-wiki GitHub Wiki
Scenario: Normally when you configure multiple repos in a single Jenkins job once the first repo is checked-out to take the checkout of 2nd repo the workspace will be wiped out.
Solution: We can use the dir command to execute a pipeline step in a subdirectory:
node {
stage('RepoA') { // for display purposes
git 'https://github.com/jglick/simple-maven-project-with-tests.git'
dir('RepoB') {
git 'https://github.com/saviovettoor/game-of-life.git'
}
}
}
Now in the workspace a subfolder will be created with name RepoB under that folder the second repo will be present.