简体   繁体   中英

Github Webhook on Local Jenkins Server

I would like to know is it possible to set a Github Webhook on Local Jenkins Server? Is there any Jenkins plugin to solve this kind of problem? Thanks.

Yes, it is possible , however you'll need to connect your local Jenkins server to the inte.net, using a tool like ngrok .

I have searched a lot to configure my local jenkins server with Github Webhook and finally with the help of serveo.net make it work by following below steps -

  1. Open terminal and paste command: ssh -R 80:<localhost_with_port_number> serveo.net

    eg ssh -R 80:127.0.0.1:8080 serveo.net

  2. It will give you an accessible url -

    在此处输入图像描述

  3. Your local jenkins server will be accessible on given url -

    在此处输入图像描述

  4. Use this url in your webhook configuration -

    在此处输入图像描述

    Now your local jenkins server is ready to test any CICD activity...

    Note: Each time it may generate a different url and in that case you have to update webhook configuration.

    Happy learning!

In your Jenkins server, Go to “Manage Jenkins” -> “Manage Plugins” as shown below:在此处输入图像描述

Search for GitHub plugin in the available list of plugins and install it, as shown below.

在此处输入图像描述

Next go to your GitHub project's settings, click the webhooks tab on the left as shown below and add the Jenkins GitHub plugin's webhook URL there.

在此处输入图像描述

Everytime, a Git pull or Git push event happens, GitHub will send a HTTP Post notification to your Jenkins server via the GitHub plugin.

You need a service like SocketXP to interconnect online GitHub or GitLab or Bitbucket project with your Jenkins server running in your local.network or in your private cloud.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM