I am defining MultiBranchPipeline in Jenkins which clones the Project1. Now I define a step to clone a Project2 as well, but it would overwrite the content of the Project1.
pipeline {
agent {
label 'agent'
}
stages {
stage('Project1 checkout automatically') {
steps {
script {
echo "Project1 is cloned automatically by the given Jenkins configuration"
//e.g. : base/Project1
}
}
}
stage('Project2 checkout phase'){
steps{
git branch: 'master',
credentialsId: 'b9152824f',
url: 'https://git/Project2.git'
//e.g. : base/Project2
}
}
}
}
So, this will override the content of the base
folder only with base/Project2 content.
Is there some simple solution which I can use to merge Project2 content into the content of the existing Project1 so I get both: base/Project1
and base/Project2
folders