Ok I figured ths out, we pass branch name along with URL

 curl 
http://jenkins.abc.com:8081/git/notifyCommit?url=g...@gitserver.abc.com:test-repo.git
&branches=xyz

Thanks,
Maneesh

On Saturday, April 5, 2014 3:21:55 PM UTC-7, Maneesh M P wrote:
>
> Hello,
>
>    I have a jenkins + git build environment . Currently my builds are 
> configured to poll for scm changes in every 5 minutes, if it detects a 
> change, builds gets triggered.  To get rid of the scm polling, I have 
> configured a post-receive git hooks.
>
> I have the below command inside the hook,
>
>  curl 
> http://jenkins.abc.com:8081/git/notifyCommit?url=g...@gitserver.abc.com:test-repo.git
>
> This works great and it schedules the job if "poll SCM" option is enabled. 
> But the problem is
>
> I have two pipeline jobs, one for master branch and one for release 
> branch. When i configured the Jenkins polling, it polls and detects the 
> changes in correct branch and schedules only that  job.
> But with the post-receive hook, my both jobs are getting scheduled . I 
> don't want that. If the changes are pushed to master, I want only job 
> configured for master branch should be scheduled or changes are pushed to 
> release i want only job configured to release branch should be scheduled. 
>
> How can i do this? Can anyone help me to resolve this issue? 
>
>
> Thanks,
> M
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to