Skip to content

GitLab Integration ​

Buildnote connects to GitLab through a webhook. You can also call the Buildnote CLI in your pipelines to collect more events.

GitLab Webhook ​

Step 1. Connect GitLab Webhook Integration ​

In Buildnote, go to Settings > Integrations and connect GitLab Webhook.

Connect GitLab Webhook Integration

Step 2. Create Webhook ​

Create the webhook in Buildnote by pressing Create Webhook.

Create GitLab Webhook In Buildnote

IMPORTANT

Buildnote shows the webhook details only once, right after you create the webhook. Note them down or keep the page open.

GitLab Webhook Created In Buildnote

Step 3. GitLab Webhook Configuration ​

In GitLab, go to Project > Settings > Webhooks and press Add new webhook.

Add GitLab Webhook

Paste the URL and Secret token that Buildnote showed you into the matching fields.

Configure GitLab Webhook Details

Select these triggers: push events, tag push events, merge requests, job events, pipeline events, deployment events and release events.

Configure GitLab Webhook Triggers

Step 4. Verify GitLab Webhook ​

After you save, the webhook appears under Project hooks on the same settings page. Use its Test dropdown to send a sample event and confirm that GitLab can reach Buildnote.

GitLab Webhook Created

Step 5. Integration Connected ​

When the webhook is set up, the new integration appears in Buildnote under Settings > Integrations.

GitLab Webhook Integration Connected

The GitLab Webhook integration is now connected and ready to receive events.

Calling Buildnote CLI In GitLab Pipelines ​

You can collect more events, such as test results or files, from within your GitLab pipelines.

Here's an example setup:

scripts/setup.sh:

bash
#!/bin/bash

set -e -x

curl -fsSL https://get.buildnote.io | bash
export PATH=$PATH:$HOME/.buildnote

scripts/collect.sh:

bash
#!/bin/bash

set -e -x

export PATH=$PATH:$HOME/.buildnote

buildnote collect

Basic Pipeline Integration

yaml
stages:
  - build
  - test

variables:
  BUILDNOTE_API_KEY: $BUILDNOTE_API_KEY

build_with_scripts:
  stage: build
  before_script:
    - chmod +x ./scripts/*.sh
    - ./scripts/setup.sh
  script:
    - ./scripts/collect.sh

Environment Variables

VariableDescriptionRequired
BUILDNOTE_API_KEYAPI key for uploading events to BuildnoteYes

Buildnote Limited
Registered in England and Wales, Reg: 16140412