Github - Lambda - Jenkins : conveying Github events to Jenkins Server via Lambda

10 views
Skip to first unread message

Chaitanya Bapat

unread,
Mar 7, 2020, 10:55:17 PM3/7/20
to Jenkins Users
Hello,

Previously, I had GitHub WebHook configured to talk to Jenkins Server directly (<jenkins-server>/github-webhook). We have a multi-branch pipeline setting. Jenkins is configured such that for every commit made to PR branch, build pipelines will be triggered.

Change : However, we want to stop automated triggering of Jenkins pipelines. Only want to trigger a Jenkins build for a specific PR if a specific comment is made.

This logic is handled by AWS Lambda function. Github is now configured such that GitHub WebHook now points to AWS Lambda function. Lambda function receives all events. It filters for the desired "build CI" comment and is able to trigger build on the Jenkins Server.

However, I have to manually press the "Scan Repository Now" button every time for the Jenkins Server to pick up the new PR branches; otherwise the Jenkins Server doesn't discover new PR branches (which is undesired) and it doesn't build branches on its own either (which is desired).

So my problem is : Without having to manually press "Scan Repository Now" button for Multi-branch pipeline setting, and without having automatic triggers, I want Jenkins to discover new PR branches (and not trigger builds on them). I want to use the Lambda function to tell Jenkins to trigger builds (whenever the specified comment is made)

Am I solving the problem correctly? How to achieve this?
Awaiting reply,
Thanks
Chai
Reply all
Reply to author
Forward
0 new messages