Webhook integration with local Jenkins using ngrok

Learn how to integrate webhook with local Jenkins using ngrok

Webhook integration with local Jenkins using ngrok

It is not possible to add a webhook for the Jenkins running on local host as it doesn’t have a public URL exposed over internet. To resolve this issue we can use a tool like ngrok which will expose the local server to the public internet.

What is ngrok?

ngrok exposes local servers behind NATs and firewalls to the public internet over secure tunnels. It connects to the ngrok cloud service which accepts traffic on a public address and relays that traffic through to the ngrok process running on your machine and then on to the local address you specified.

Usage:

  • Public URLs for exposing your local server
  • Public URLs for demoing from your own machine
  • Public URLs for building webhook integration

How to setup ngrok on Windows?

  • Go to ngrok website
  • Click on Download for Windows link
  • Unzip the downloaded file “ngrok-stable-windows-amd64” in any directory
  • Open your command prompt
  • Navigate to the directory where ngrok exe is present
  • Enter command “ngrok version” to verify ngrok is working

Generate Public URL for your local server

  • Run the following command ngrok http 8080

Public URLs for your local server are displayed:– 

  • http://c34ff0dd.ngrok.io
  • https://c34ff0dd.ngrok.io

Similarly, you can expose any local server to public internet.

To add a webhook for Jenkins, copy any of the url and paste in the Webhooks -> Payload URL for your Github repository as explained in the previous post.

Bijan Patel
Full Stack Test Automation Expert | Selenium Framework Developer | Certified Tosca Automation Specialist | Postman | DevOps | AWS | IC Agile Certified | Trainer | Youtuber | Blogger|

Launch your GraphyLaunch your Graphy
100K+ creators trust Graphy to teach online
𝕏
QASCRIPT 2024 Privacy policy Terms of use Contact us Refund policy