Book Image

GitLab Cookbook

By : Jeroen van Baarsen
Book Image

GitLab Cookbook

By: Jeroen van Baarsen

Overview of this book

Table of Contents (16 chapters)
GitLab Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using webhooks


GitLab allows you to set up webhooks that will be triggered every time a certain type of event is launched. In this recipe, we will take a look at how you can set up these webhooks yourself and how you can test whether they work without building a complete script around it.

How to do it…

In the following steps, we will configure the webhooks:

  1. Log in to your GitLab instance as a project owner.

  2. Go to the project for which you want to enable webhooks.

  3. Click on Settings.

  4. Click on Web hooks in the left-hand side menu.

  5. Here, you see the form that you can use to set up the webhooks. As we won't be writing a script to catch these events, we will be using a web service that enables us to catch the events.

  6. As we want to have a place to test the webhook without having to create a lot of software for it, we are going to use a service called RequestBin. Go to http://requestb.in and click on Create a RequestBin.

  7. This will give you an endpoint URL, as shown in the following screenshot:

  8. Copy the URL...