Skip to content

GitLab Integration

Buildnote offers integration with GitLab via webhook as well as calling Buildnote CLI in pipelines to collect additional events.

GitLab Webhook

Step 1. Connect GitLab Webhook Integration

In Buildnote navigate to Settings > Integrations and connect GitLab Webhook.

Connect GitLab Webhook Integration

Step 2. Create Webhook

Create webhook in Buildnote by pressing Create Webhook.

Create GitLab Webhook In Buildnote

IMPORTANT

Webhook details are only displayed once after creation, so make sure you make a note of them or stay on the page.

GitLab Webhook Created In Buildnote

Step 3. GitLab Webhook Configuration

In GitLab go to Project > Setting > Webhooks and Add new webhook.

Add GitLab Webhook

Enter details from Buildnote.

Configure GitLab Webhook Details

Select all required 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 creating webhook in GitLab you should be able to see it in the list of webhooks.

GitLab Webhook Created

Step 5. Integration Connected

Once the GitLab webhook setup is complete you should see the new integration in Buildnote under Settings > Integrations.

GitLab Webhook Integration Connected

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

Calling Buildnote CLI In GitLab Pipelines

Buildnote supports collecting additional events such as test results or files within GitLab pipelines.

The following example demonstrates this configuration:

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