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 system hooks


When you create or delete a user or project, you might want to be notified, or you might have a backend system from which you want to receive notifications for this type of events. GitLab has support for this in the form of system hooks. In this recipe, we take a look at how you can set up system hooks for your GitLab instance.

The following events can trigger a system webhook call:

  • Project created

  • Project destroyed

  • New team member

  • The team member is removed

  • A user is created

  • The user is removed

How to do it…

In the following steps, we will set up the system hooks:

  1. Log in to GitLab as an administrator.

  2. Go to the Admin area section.

  3. Click on Hooks.

  4. 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.

  5. Copy the URL that is given on that page, and paste it to GitLab in the hook's URL field.

  6. When you click on Add System Hook, the hook will...