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 GitLab CI webhooks


It is possible to have GitLab CI call a webhook whenever a build is run. Setting this up is really straightforward.

How to do it…

Let's set up the webhook with the following steps:

  1. Log in to your GitLab CI app as an administrator.

  2. Click on the project you want to have webhooks enabled for.

  3. Go to the webhooks page.

  4. Here, you find an input field where you can enter the URL for the webhook.

  5. Click on Add web hook.

  6. This will add an entry to the enabled webhooks.

  7. To test whether the webhook is sending the correct information, you can click on the Test Hook button. This will send a sample message to the configured webhook.

How it works…

By configuring the webhook, you can receive notifications about the build status of your commits. This can be a system that checks the incoming message to see whether the build was successful, and if it was, it can deploy the build to a staging or production server.

You can also use the information provided by the webhook to create statistics about...