github - Jenkins git commit for specific branch triggers build jobs for other branches too -


we have internal enterprise github repo, , have multiple feature branches. facing issue triggering build on specific branch. have configured jobs each of feature branches. there 1 jenkins job 1 feature branch. first time commit code, triggers builds jobs other branches.

steps reproduce problem:

1.we have internal github enterprise. repo, have setup webhook github below

 settings -> webhooks & services -> services  select jenkins (github plugin)   jenkins hook url: http://************/jenkins/github-webhook/ 

2.for 3 branches in github repo : branch1, branch2, branch3, created 3 jobs in jenkins:job1, job2, job3 scm configured below

source code management: repo url: git@********/********.git branches build: refs/heads/branch_name  build trigger: build when change pushed github 

3.on committing code branch : branch1. triggers 3 jobs in jenkins: job1, job2, job3. note:this first time jobs triggered.

4.on committing code second time branch: branch1. triggers job1 in jenkins.

it looks first time jobs getting executed repo, irrespective of branch.

details on jenkins setup: jenkins version: 1.565.1, github plugin: 1.9.1

any help/guidance solve issue appreciated.

fyi: tried steps listed http://kohsuke.org/2011/12/01/polling-must-die-triggering-jenkins-builds-from-a-git-hook/

make script follow command (assuming github linux)

curl http://yourserver/jenkins/git/notifycommit?url=<url of git repository> 

put script in ./git/hooks

in jenkins jobs change

from "build when change pushed github"

to "poll scm"

don't create schedule in poll scm


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -