I would use Generic Webhook Trigger Plugin for this.

https://github.com/jenkinsci/generic-webhook-trigger-plugin

It would mean you have to know what the JSON looks like that is being sent 
from GitHub:s webhook then extract variables and develop a filter.

There are some examples of filter here:

https://github.com/jenkinsci/generic-webhook-trigger-plugin/tree/master/src/test/resources/org/jenkinsci/plugins/gwt/bdd

And the GitHub webooks are well documented here:

https://developer.github.com/v3/activity/events/types/#pushevent


Den onsdag 14 mars 2018 kl. 21:54:12 UTC+1 skrev Mathieu Morneau:
>
> Hello.
> I have several issues with Github and jenkins 2 pipelines together.
>
> 1st - We are not using the multi branch plugin, and we do not want to. 
> There are plenty of code branches (70+), and we don't want to have 
> jenkinsfile in any of them.
> 2nd - We are using a shared library, and all the pipelines are stored 
> inside it in a pipeline folder.
>
> Since teams that code, and teams that manage the builds are different, we 
> want it that way. And there is 
>
> Now, the bugs/problems/insight needed
>
> A ) The changes listed on a built job are coming from the Jenkinsfile 
> github repository instead of the git checkout done in the pipeline. There 
> is no "No poll" option in the Pipeline SCM definition ?
>
> B ) The "GitHub hook trigger for GITScm polling" and "Poll SCM" do not 
> send the branch name when triggering a build... why ? They did with 
> freestyle project...
>
> C) The checkout step supports regular expression for branch name, but 
> can't take advantage of that because of B) ...
>
> D ) The git step has no refspec parameter.. why provide an incomplete step 
> ? It's syntax is quite better and more modern than the checkout step. I've 
> hidden the checkout step inside a gitChekcout custom step. 
>
> Right now, we are using an old job that is triggered by  "GitHub hook 
> trigger for GITScm polling". This job then triggers the pipeline job with 
> the branch name as a parameter. It is really .. yuck.
>
> Anyone knows something about any of these issues ?
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/4ce3c128-eb08-4ce8-b1c9-271bb114d76c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to