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.
Step 2. Create Webhook
Create webhook in Buildnote by pressing Create Webhook.
IMPORTANT
Webhook details are only displayed once after creation, so make sure you make a note of them or stay on the page.
Step 3. GitLab Webhook Configuration
In GitLab go to Project > Setting > Webhooks and Add new webhook.
Enter details from Buildnote.
Select all required triggers: push events, tag push events, merge requests, job events, pipeline events, deployment events and release events.
Step 4. Verify GitLab Webhook
After creating webhook in GitLab you should be able to see it in the list of webhooks.
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 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:
#!/bin/bash
set -e -x
curl -fsSL https://get.buildnote.io | bash
export PATH=$PATH:$HOME/.buildnote
scripts/collect.sh:
#!/bin/bash
set -e -x
export PATH=$PATH:$HOME/.buildnote
buildnote collect
Basic Pipeline Integration
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
Variable | Description | Required |
---|---|---|
BUILDNOTE_API_KEY | API key for uploading events to Buildnote | Yes |