Reputation: 1161
I would like to initialize an environment when a new branch is created. I would not like to run a job every time something is committed, only when it is a new branch.
Upvotes: 0
Views: 284
Reputation: 1161
The solution I went with is to put logic into my jenkinsfile. Since I'm building the multibranch pipeline from one. I added the logic below...
stage('Deploy') {
steps {
script {
if (env.BUILD_NUMBER == '1') {
build job: 'new env'
}else{
build job: 'deploy'
}
}
}
}
Upvotes: 1