Closed anuragkapur closed 10 years ago
There is not support for this at this time. The easiest setup here would be to configure your Jenkins job to build for only certain branches.
If this isn't a potential solution for you, let me know, as I'd like to understand more of your use case. I'd prefer to keep that logic in Jenkins, as it's already there and can cause confusion for others as configuration is then occurring in two different systems.
Thanks for your response. My use case is -
We commit back the version number into the pom of our project after a successful build.
So when a change to a branch, say "xyz" triggers the jenkins job, jenkins builds "release" branch again as it sees a commit in "release" which was just a release number change (which I don't want to build).
Let me explain it below:
So because we want the version number of our pom pushed back to "release" just relying on jenkins to build "release" is not sufficient. We need to stop the webhook from firing if the change is not pushed to a pre-configured branch name.
Ok. I see how that causes a problem.
Just wondering/more clarification... when you commit and push the update in Step 3, doesn't this cause another webhook notification to be fired? I'm kinda wondering how that isn't causing an infinite loop there.
Infinite loop is prevented as we always commit back the version update in pom from a specific user and use the feature in the webhook to ignore specific users. I think this feature was introduced in v2 of webhook. So that works and we don't get into an infinite loop.
Do you think something could be added in the webhook to cater to the scenario I described?
Many thanks for your prompt responses.
Ok. Makes sense. I'll go ahead and add this to the to-do list. I wouldn't expect it to last very long, but may be a few days. For you right now, would you prefer to whitelist or blacklist branches to trigger? Figured I'd start with one and go from there.
Brilliant. Thanks a ton! A whitelist would be ideal for our use-case.
On 18 Mar 2014, at 19:09, Michael Irwin notifications@github.com wrote:
Ok. Makes sense. I'll go ahead and add this to the to-do list. I wouldn't expect it to last very long, but may be a few days. For you right now, would you prefer to whitelist or blacklist branches to trigger? Figured I'd start with one and go from there.
— Reply to this email directly or view it on GitHub.
Sorry to be a pain. Roughly when do you plan to have this change available for use?
No worries. I was hoping to get it done thus past weekend but got hit with bronchitis, which just knocked me out for a few days. Can we shoot for Wednesday? That work for you?
Hope you feeling better! Yes, Wednesday sounds great. Thanks!
You up for trying out a snapshot version? If so, I have it linked below. Go into your plugin management, uninstall the old version, then upload the jar. Don't worry... no settings will be lost during this process.
After installation, you should see the new branch options in the Advanced Configuration section. I was able to plug in both whitelist and blacklist functionalities. If you could try out your use case, I'd be happy to hear if labeling makes sense, it's easy to use, etc. Any feedback at all would be greatly appreciated.
Thanks!
http://nerdwin15.com/public/stash-webhook-jenkins-2.4.0-SNAPSHOT.jar
Thanks a ton. I should be able to get this tried tomorrow. I am not the stash admin at our company, but I should be able to speak to the right person and get this tested. I shall get back to you. Thanks once again.
Anurag Kapur
@anuragkapur http://www.twitter.com/anuragkapur http://www.anuragkapur.com
On Tue, Apr 1, 2014 at 8:53 PM, Michael Irwin notifications@github.comwrote:
You up for trying out a snapshot version? If so, I have it linked below. Go into your plugin management, uninstall the old version, then upload the jar. Don't worry... no settings will be lost during this process.
After installation, you should see the new branch options in the Advanced Configuration section. I was able to plug in both whitelist and blacklist functionalities. If you could try out your use case, I'd be happy to hear if labeling makes sense, it's easy to use, etc. Any feedback at all would be greatly appreciated.
Thanks!
http://nerdwin15.com/public/stash-webhook-jenkins-2.4.0-SNAPSHOT.jar
Reply to this email directly or view it on GitHubhttps://github.com/Nerdwin15/stash-jenkins-postreceive-webhook/issues/58#issuecomment-39250707 .
Just finished looking at this in out stash installation. Works like a charm. Many thanks!
Perfect! I'll go ahead and get it ready for a release on the Atlassian Marketplace. Thanks for your help!
Closing this as it has been implemented and released. Thanks again for your help, suggestion, and feedback!
Hi @mikesir87 is it available for bitbucket as well.
Yep I would like this on bitbucket also.
One more request vote for Bitbucket :+1:
Hi @mikesir87
I am facing an issue integrating Stash(3.2) with Jenkins. My Observation is Local git commit (local)are firing GET request to jenkins,but git push(push) is not firing . As a result ,Jenkins polling is not detecting any Changes and jenkins statys 1 commit behind.
Does this only work with BitBucket or will it also work with Github. Because I think github plugin for jenkins does not have branch filter in webhook. Can I implement same thing in Github-plugin for jenkins too,
I want to configure webhooks in GitHub for particular branch commit changes then Jenkins job needs to build.
Please give me solution for above query
Is it possible to configure the webhook to be triggered if there is a change to a specific branch?
For example, I would like to trigger a jenkins job only if there is a push to a branch called "release".