0

I am using the git plugin for jenkins. It works well, except that it rebuilds my targets any time ANY of the branches are changed on the given project. What I need it to do is rebuild ONLY IF a particular branch has been changed. Is there a way to do this? Right now I am using git hooks and the notifyCommit option with the plugin. Thanks

Andrew Rhyne
  • 5,060
  • 4
  • 28
  • 41

1 Answers1

2

Under Source Code Management you can set the Branches to build field to your desired branch.

cjc343
  • 3,735
  • 1
  • 29
  • 34
  • 1
    Yes, but it still builds when I change other branches. – Andrew Rhyne Mar 14 '13 at 16:54
  • What format did you use? Personally, I just use `BRANCH` which should be shorthand for `*/BRANCH` and it works fine. I'm definitely not fully up to date on plugins or Jenkins though. – cjc343 Mar 14 '13 at 17:06
  • That shouldn't be any different than a job kicked off by a polling schedule. I was referring to the format of the `Branches to build` field. Which fix did you use for `UnknownHostKey` error? I haven't tested versions past 1.1.26 and it's unclear from those bugs whether the `GIT_BRANCH` env variable might be ignored in 1.2.0 and 1.3.0. – cjc343 Mar 14 '13 at 19:32
  • For the unknownhostkey error, checkout out this: https://issues.jenkins-ci.org/browse/JENKINS-17204 Its the comment on 14/Mar/13 2:53 AM – Andrew Rhyne Mar 14 '13 at 19:53
  • Do that, then do sudo /etc/init.d/jenkins restart – Andrew Rhyne Mar 14 '13 at 19:53