Integrating GitLab with Sleuth is simple. If you're connecting to a personal GitLab repo, you just need your credentials. If you're part of an organization and aren't the owner, you will need permission to allow Sleuth to connect to the repo—after you connect you'll be able to select individual private or public repositories.
To set up the GitLab integration:
- 1.Click Integrations in the left sidebar, then select Code in the dropdown at the top-right to filter the view.
- 2.In the GitLab tile, click Enable.
- 3.You must grant Sleuth access to your GitLab account. Don't worry, you'll select the GitLab repo to connect to your Sleuth project later.
- 4.On successful integration, GitLab enabled will be displayed in the GitLab tile. You'll next configure the code deployment to connect your repo to a project.
If you using GitLab on-premise behind Cloudflare access or similar, Sleuth might need to include some HTTP headers in order to reach your instance. In order to set Sleuth to send any custom HTTP headers when making requests:
- 1.In the GitLab dialog, click on the Advanced setting
- 2.Enter comma separated list of custom headers you want Sleuth to include
GitLab can be configured in read-only mode, making use of a read-only token from GitLab. Several Sleuth features such as deployment locking and some Sleuth Action automations may be disabled, but if your security team requires integrations to be read-only, this may be necessary.
- 1.In the GitLab dialog, click on Advanced settings and check Read-only checkbox.
- 2.Continue to add a new code deployment as usual.
- 3.Now, you'll need to manually configure the GitLab webhook so that Sleuth is notified about key events. Visit the code deployment page, click on the cog at the top right and select Get webhook instructions\
- 4.Copy the webhook URL, secret, and note the events for later
- 5.Visit your GitLab repository settings and click on Webhooks
- 6.Create a new webhook, using the URL and secret from the earlier dialog, and check the events that match with the requested list
- 7.Save the new webhook and now Sleuth should receive the required GitLab events.
Steps 3 through 7 need to be done for each GitLab repository
- 1.Click on Integrations in the left sidebar, then on Change Sources.
- 2.In the GitLab integration card, click disable.
The GitLab integration is disconnected and no longer available to any projects within that organization.