Skip to main content
Sourcebot can sync code from GitLab.com, Self Managed (CE & EE), and Dedicated. If you’re not familiar with Sourcebot connections, please read that overview first.

Examples

This option is ignored if url is unset. See connecting to a custom gitlab host.

Authenticating with GitLab

In order to index private projects, you’ll need to generate a GitLab Personal Access Token (PAT). Create a new PAT here and make sure you select the read_api scope: GitLab PAT Scope Next, provide the PAT via the token property, either as an environment variable or a secret:
  1. Add the token property to your connection config:
  1. Pass this environment variable each time you run Sourcebot:

Connecting to a custom GitLab host

To connect to a GitLab host other than gitlab.com, provide the url property to your config:

Troubleshooting

  • If you’re seeing errors like GitbeakerTimeoutError: Query timeout was reached when syncing a large number of projects, you can increase the client’s timeout by setting the GITLAB_CLIENT_QUERY_TIMEOUT_SECONDS environment variable. #162

Schema reference

schemas/v3/gitlab.json