pipelines - multiple branches

49 views
Skip to first unread message

Mathieu Morneau

unread,
Mar 14, 2018, 4:54:12 PM3/14/18
to Jenkins Users
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 ?

Tomas Bjerre

unread,
Mar 31, 2018, 10:37:01 AM3/31/18
to Jenkins Users
I would use Generic Webhook Trigger Plugin for this.


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:


And the GitHub webooks are well documented here:

Reply all
Reply to author
Forward
0 new messages