IP address of localhost:8080 -in webhooks of github +jenkins

10,011

Solution 1

You need a public address for Github to point to when detected a push request. localhost is on your localmachine.

The way i solved it is to use a proxy agent Ngrok. Enter command >ngrok http 8080, it will generate http://{hexa-numbers}.ngrok.io copy the generated public address and put in your github repository webhook http://{hexa-numbers}.ngrok.io/github-webhook/.

At this point when you save it, it will send a post request to ngrok server, got redirected to localhost and you will see a green tick.

Solution 2

If you are talking about github.com, then yes, localhost would not work.
As mentioned in "GitHub webhook configuration "

the Jenkins instance must be able to connect to GitHub and vice versa.

You can check that with the "Test hook" button from the GitHub UI and see if Jenkins receive a payload.

Make sure you have the JENKINS GitHub Plugin properly installed and configured.

Share:
10,011
Naveen DINUSHKA
Author by

Naveen DINUSHKA

Passionate about agile, dev and testing

Updated on July 28, 2022

Comments

  • Naveen DINUSHKA
    Naveen DINUSHKA almost 2 years

    I am trying to configure webhooks in github so that it will deploy every time I do a new push, I have added web hooks in github and given the address of jenkins which is http://localhost:8080/github-webhook/ but it did not work and I found out that we need to find our IP address and I added it as follows:

    http://'ipaddress'/github-webhook/
    

    but I still did not get the jenkins to work? Thanks

  • Anthony Fammartino
    Anthony Fammartino almost 6 years
    For me, ngrok is a major revelation. Thank you for this answer.
  • nedstark179
    nedstark179 about 5 years
    If you have a username and password set for your Jenkins, you might need to do the following: Configure Global Security -> Authorization -> Allow anonymous read access
  • Danil.T
    Danil.T about 4 years
    How would you run ngrok continuously? It's only a temporary adress and the hexa-numbers change everytime you start it. So you would have to change the webhook settings everytime.