0.Expose local jenkins to the internet by ngrok
Currently in our Jenkins setup, we're deploying and working in local machine and not expose this to the internet.
So in order for github can access to the local Jenkins, we would need some tool to expose Jenkins to the outside world.
Here is how it works with ngrok tool.
You can download ngrok tool from the official site: ngrok site
After download and install, if you want to expose some local site to the outside, you need to specify the port and run the following command:
As in Windows : ngrok.exe http 8080 (example for port 8080 which is default port of Jenkins)
After that, you can use the following example address for working with github: https://27698b0d.ngrok.io
In order for Jenkins to know when there is any code change in github, you need to set the webhook.
Following is how to do it with github.
Click on Add webhook button, setup as the following:
Then choose Add→ If the icon is set to green, you're good to go (big grin)
2.Setup job build in Jenkins
Now it comes to Jenkins part.
First, you need to add Jenkins Job → Choose Configure
Thanks for reading.
Hope this helps.