Github push event fails to trigger pipeline job in jenkins

340 views
Skip to first unread message

Ramanathan Muthaiah

unread,
Jun 18, 2017, 1:05:57 AM6/18/17
to Jenkins Users
Hi All,

This is a re-posting of the issue from https://issues.jenkins-ci.org/browse/JENKINS-44955.

After several readings of the documentations available on the Internet, I decided to post the issue here and seek help.


I've created a small pipeline that uses basic steps to print messages on stdout, list files in dir. This job is working fine when triggered manually. The job's pipeline script is hosted in a public github repo which is hosted in our internal github enterprise server. 


Github webhook was setup in such a way as to accept any event that arrives at this repo and send the event to the jenkins master. Though the push event reaches the Jenkins master, build job is not triggered.


I have attached the screenshot of the jenkins log where the push event is noticed.


Am I missing something here? 


Any help would be appreciated.


/Ram

Screen Shot 2017-06-18 at 9.06.51 AM.png

Lee Meador

unread,
Jun 20, 2017, 1:58:29 PM6/20/17
to jenkins...@googlegroups.com
Is it a plain pipeline job? If so, you need to click the option to trigger a build on a GitHub change.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0d995db5-9093-4e7d-868c-2fd8017a9f39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-- Lee Meador
Sent from gmail. My real email address is lee AT leemeador.com

Ramanathan Muthaiah

unread,
Jun 25, 2017, 5:02:48 AM6/25/17
to Jenkins Users, l...@leemeador.com
Hi Lee,
 
Is it a plain pipeline job? If so, you need to click the option to trigger a build on a GitHub change.

Yes, the job is setup as pipeline style and that option (to trigger build on Github change) is enabled.

Are there any extra commands needed in the pipeline job to indicate that it should be triggered when github event occurs, like, commit or pull request?

/Ram 

Ramanathan Muthaiah

unread,
Jul 1, 2017, 11:37:46 AM7/1/17
to Jenkins Users, l...@leemeador.com
For the benefit of those who may come across similar issue, let me share some details of how this was fixed.

Internal Setup:
============
Jenkins instance is in cloud, from the cloud we have no direct connectivity to enterprise github server which is in a data center.
And, requests from Jenkins to github was routed via proxy in cloud.

Given this setup, we opted to go for AWS SNS + AWS Lambda solution.

Event Flow:
==========
In Github repo, SNS topic is added and the payload of Github event is sent to Lambda which subscribes to SNS topic.
Lambda processes the payload and relays it to appropriate Jenkins master (multiple masters in cloud).

Problem:
=======
However, PUSH event that reaches the master (correctly) was not triggering the job (both freestyle and pipeline).
It turned out be that github URL that reaches the master was not matching with URL set in the job config.

Recall from the setup section, Jenkins' communicates with the github server via the proxy.
It was this URL (pointing to the proxy) that was in the job but the event payload sent from github had different URL.

So, in the Lambda, we changed the URL to match with that of the proxy before relaying to Jenkins master.
Eventually, this did the trick and PUSH event was followed by poking of the job that resulted in triggering a fresh build of that job.

Overall, it was good learning experience.

/Ram
Reply all
Reply to author
Forward
0 new messages