# GitLab deployment pipeline

GitLab is a complete DevSecOps platform that enables teams to collaborate on planning, development, CI/CD, and deployment in a single application. Display your GitLab deployment pipelines in the ilert and enrich alerts context. This integration helps you better understand the context of incidents and improves your MTTR.

## Setting up

### Creating your deployment pipeline in ilert

In any way, a pipeline is required, which will also generate a new `integrationKey` required to route deployment events when they occur. Head to your ilert account and navigate to **Alert sources -> Deployment events.**

<figure><img src="/files/hVN7pLmMiQbUSidJ8ekk" alt=""><figcaption></figcaption></figure>

Head over to the deployment pipelines tab and click on **Create new pipeline.**

<figure><img src="/files/6NtTGB1HfaMrIZq5bWFk" alt=""><figcaption></figcaption></figure>

Provide a name for your pipeline.

<figure><img src="/files/X1KUcsTheU48GTIuHKy3" alt=""><figcaption></figcaption></figure>

**Optional**: If you are going to manage branch-specific deployments, choose the branches in the branch filter section for which you would like to create deployment events in ilert.

<figure><img src="/files/Rn3uiVaLLq3GhjQ5BiwT" alt=""><figcaption></figcaption></figure>

**Optional**: If you would like to use a global webhook flow, where you coordinate specific deployment events for different repositories across multiple pipelines, you can use the event filters to fine-tune which specific event types should create deployment events in ilert and drop other ones. (*This is mainly useful when using multiple GitLab account-wide webhooks*).

<figure><img src="/files/OPC5rh30VfPO3rLvJohH" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
We generally recommend Release-based deployment events, as these are the easiest to set up and provide the most foundated correlations. Note that Push-based deployment events can become very spammy, especially when used with Github account-wide webhooks.
{% endhint %}

In any way, by clicking on Create, you should end up on the detail view of your GitLab deployment pipeline.

<figure><img src="/files/YrQM29MIa3RUyNV4IoPA" alt=""><figcaption></figcaption></figure>

Providing you with a freshly generated `integrationKey` and copy & pastable **URL** ready for your webhook setup.

### Creating an account-wide GitLab webhook for your pipeline

Head to your (or your organization's) GitLab groups settings page **Home -> Groups -> Settings (left sidebar) -> Webhooks -> Add webhook.**

<figure><img src="/files/ERhtsR7GKFcYBKvOFbvs" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ITu4Fq3bC5qN9JBbDGY7" alt=""><figcaption></figcaption></figure>

Create a new webhook by **pasting the URL** from your freshly created ilert deployment pipeline into the URL field.

<figure><img src="/files/GG0tF5zAWPalig8voAKW" alt=""><figcaption></figcaption></figure>

Scroll down the list and choose whichever suits your setup of `Push events, Merge request events and Releases events` (*you can also mark all and use the ilert event filter in your pipeline to switch faster in the future*).

<figure><img src="/files/UQYgT87X5BhU3bzlRW0s" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/7nnYXG6lH9tRrkGv9zE8" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ENdmxyZ1vB4gHWxa8wxR" alt=""><figcaption></figcaption></figure>

When you are done, click "**Add webhook**" for your webhook to be created. You are now all set and should see deployment events coming into your ilert account.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ilert.com/integrations/deployment-integrations/gitlab.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
