1
votes

Were trying to use a Jenkins Workflow script to build multiple branches of the same repo.

So essentially we want the job to react to changes in BranchA and BranchB and build whichever one has changed.

From what I can understand about how SCM polling works with Workflow the branch that is being monitored is determined the first time the job runs based on which branch is cloned.

Does this mean this kind of multi-branch set-up isn't possible?

1

1 Answers

1
votes

Install the Workflow: Multibranch plugin and create a multibranch workflow project. Each branch with a Jenkinsfile script will be built. Use checkout scm to check out sources.