Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 2.35 KB

create-a-webhook.md

File metadata and controls

54 lines (40 loc) · 2.35 KB

Creating a webhook

When you push new code into your repository, you have to notify your build server that new code is available. This is what webhooks are for. Please read the paragraph corresponding to your used Git system. For every webhook, you will need your build URL. As URL, you need to supply the address of your build server and the corresponding token, e.g. http://my-build-server.com:8271/api/v1/receive?token=.

With most Git services, the process is largely the same. Select the repository, go to Settings/Webhooks and supply the build URL. Please read the specifics below.

BitBucket

  1. Go to BitBucket.org and log in using your credentials
  2. Click the repository you want to create a webhook for.
  3. On the left, click Repository settings.
  4. In the Repository settings, click Webhooks.
  5. Click Add webhook.
    • As a title, you can enter whatever you want, e.g. Build Webhook.
    • Enter the build URL.
    • For debugging purposes, enable request history collection.
    • Click Save.

More Info: https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html

GitHub

  1. Go to GitHub.com and log in with your credentials.
  2. Click the repository you want to create a webhook for.
  3. Click Settings on the right side.
  4. Click Webhooks.
  5. On the right side, click Add webhook and re-enter your password, if required.
  6. Enter the build URL, set the content type to application/json and click Add Webhook.

More Info: https://developer.github.com/webhooks/

GitLab

  • Go to GitLab.com and log in with your credentials.
  • Click the repository you want to create a webhook for.
  • On the left, Click Settings -> Webhooks.
  • Enter the build URL. As a trigger, check Push events. Click Add webhook.

More Info: https://gitlab.com/help/user/project/integrations/webhooks

Gitea

  • Go to your Gitea installation URL and log in.
  • Click the repository in question.
  • On the top right, click Settings, then Webhooks, then Add Webhook and Gitea.
  • Supply the build URL. Set Method to POST and content type to application/json, if not already set. As triggering event, set the Push-Event. To finish, click Add Webhook.

More Info: https://docs.gitea.io/en-us/webhooks/