Re: GitHub webhook push CI issue with pipeline projects

62 views
Skip to first unread message

Cory Grubbs

unread,
Nov 10, 2016, 12:55:52 PM11/10/16
to Jenkins Users
As a managed service which utilizes Jenkins for CI builds, I have created a generic pipeline script which is used by all projects to build. The script reads in application specific property files which drives what gets executed within the pipeline.

The generic pipeline script and the application specific property files are stored within my github repository.

The problem I’m running into is when trying to setup push CI events via webhooks on application source repositories. If there is a source commit/push on an application source repository, I want to trigger a build of the corresponding Jenkins pipeline project. Because there is no direct source configuration within the pipeline project, there doesn’t seem to be a way for the webhook to associate where the commit took place with the given pipeline project and invoke a build.

I was hoping the “GitHub project url” field would allow me to associate the pipeline project with the application source repo that the webhook should trigger builds on, but that doesn’t seem to be the case.

Please assist with guidance on how this can be accomplished.

Cory

Indra Gunawan (ingunawa)

unread,
Nov 10, 2016, 3:49:29 PM11/10/16
to jenkins...@googlegroups.com
You can create a job that polls for the commit/push to the application
source repository. This job will then simply trigger the pipeline job.

On 11/10/16, 9:55 AM, "jenkins...@googlegroups.com on behalf of Cory
Grubbs" <jenkins...@googlegroups.com on behalf of
>--
>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-use...@googlegroups.com.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/jenkinsci-users/5768597b-012d-4466-b8c8-
>2431a1fd0f32%40googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

Cory Grubbs

unread,
Nov 10, 2016, 5:17:18 PM11/10/16
to Jenkins Users
The whole objective is to get away from poll based CI as it places unnecessary and unsustainable load on both the source control system and Jenkins when you have thousands of projects continuously polling. In addition this is not a scalable/efficient solution in that you would have to create 2 Jenkins projects for every single build job.

This is why I'm looking for a way to associate a pipeline project to a specific github repo so that the webhook knows which project to execute when invoked from github.

Indra Gunawan (ingunawa)

unread,
Nov 10, 2016, 8:13:02 PM11/10/16
to jenkins...@googlegroups.com
The 1st job does not need poll. If you have Github plugin and have
configured and installed github-webhook on the source git repository on
GitHub, you enable it to trigger with Github build trigger ³Build when a
change is pushed to GitHub².

You can only associate the pipeline with the source repo if you also
commit the jenkinsFile into the same source repo.



On 11/10/16, 2:17 PM, "jenkins...@googlegroups.com on behalf of Cory
Grubbs" <jenkins...@googlegroups.com on behalf of
cagru...@gmail.com> wrote:

>--
>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-use...@googlegroups.com.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/jenkinsci-users/b2a91747-43ba-4cfa-8462-
>3b57b5253620%40googlegroups.com.

Cory Grubbs

unread,
Nov 10, 2016, 10:48:12 PM11/10/16
to Jenkins Users
Ok....still doesn't solve the problem of having to have two separate Jenkins projects for every build which is not efficient nor scalable to the level I need it to be.

I find it hard to believe you can't configure a webhook on a github repo to kick off a specific Jenkins job that isn't connected to the repo but I sure can't figure out how.

What is the purpose of the Github project field within the Jenkins job configuration if it doesn't create the necessary association for webhooks to invoke the job when changes are pushed to the specified github repo?

Cory

Indra Gunawan (ingunawa)

unread,
Nov 11, 2016, 1:49:20 PM11/11/16
to jenkins...@googlegroups.com
The purpose of Github project field In the Jenkins Job configuration is
just to make Github available in the Jenkins left-nav.



On 11/10/16, 7:48 PM, "jenkins...@googlegroups.com on behalf of Cory
Grubbs" <jenkins...@googlegroups.com on behalf of
cagru...@gmail.com> wrote:

>--
>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-use...@googlegroups.com.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/jenkinsci-users/11eac010-ef97-4eba-9123-
>ab7bd4eff432%40googlegroups.com.
default.png

kishore babu

unread,
Oct 24, 2019, 9:18:07 AM10/24/19
to Jenkins Users
I hope you got the solution, If you could suggest me the best practice it will be helpful for me.
Reply all
Reply to author
Forward
0 new messages