TheLucas
TheLucas

Reputation: 1

Jenkins SCM polling not polling the correct branch

I'm using Jenkins on a CI environment, with the plugin for SVN. The build polls SCM every minute for new changes, and triggers if there are any.

The problem is that we need to change from one branch to another with regularity. When this happens, the correct branch is checked out, but jenkins continues polling the old branch.

What do I have to do for it to always poll the correct branch?

EDIT:

With multibranch pipelines, it will create a sub-job for each branch. We can do the polling by just adding

triggers {
    pollSCM('* * * * *')
}

under 'pipeline' on the jenkinsfile. Now these sub-jobs will not need to change branch, because there is one for each branch. This avoids the issue I was having before.

Upvotes: 0

Views: 723

Answers (1)

dalmo.santos
dalmo.santos

Reputation: 79

If you are using Jenkins 2, it is recommended to use the multibranch pipeline, along with jenkinsfile in the SVN repository

Upvotes: 0

Related Questions