GitLab
Orbit builds and deploys from gitlab.com and from a self-managed GitLab, with deploy on push and merge request previews, the same way it does from GitHub.
Connecting GitLab
In Settings → Integrations → Connect GitLab, or when you pick GitLab in a new project, give Orbit:
- The address of your GitLab, such as
https://gitlab.example.com. Leave it empty for gitlab.com. It must be HTTPS. - An access token with the
apiscope. A group access token is the best fit: it reaches every project in the group and nothing else. A project access token works for one project. A personal access token works too, but it acts as you everywhere.
Why api: it is the only scope that lets Orbit add the webhooks that deploy on push. Orbit only uses it to read the projects, their branches and files, and to add and remove its own webhooks. A token without it is refused with a message that names the missing scope.
Give a group or project token the Maintainer role. With a lower role, Orbit still builds and deploys, but GitLab does not let it add webhooks, so pushes do not deploy on their own; Settings says so for each project.
- Where the token lives: it is sealed in Orbit's secret store, never shown again and never written to the logs. It travels with
orbit backup. - Expiry: GitLab tokens expire. Settings shows the token's name and the day it expires; connect again with a new one before then.
- Each workspace connects its own GitLab, so two workspaces can use two GitLab instances.
Choosing a project
In a new project, choose Git repository, then GitLab. Orbit lists the projects the token can read, most recently active first, including those in subgroups (group/subgroup/project). Pick one and a branch, and Orbit reads the branch without cloning it to detect how to build and run it, as it does for GitHub. Builds download the commit's archive with the token.
The Compose import also reads a compose.yaml from a GitLab project.
Deploying on push
When an application is created from a GitLab project, Orbit adds a webhook to that project. It sends pushes and merge requests to https://orbit.<server-ip-with-dashes>.sslip.io/gitlab/webhook/<workspace>, with a secret token GitLab puts in the X-Gitlab-Token header.
- A push to an application's branch deploys that commit when Deploy automatically is on in the application's settings.
- The same delivery sent twice, such as a retry or a Resend request from GitLab's webhook page, deploys once.
- Settings → Integrations lists each project's webhook, or why it could not be added.
- Self-managed GitLab: your GitLab must reach Orbit's HTTPS address. If GitLab cannot resolve or reach it, the webhook is added but pushes never arrive; deploy from the console instead.
Merge request previews
Previews follow the same rules as pull request previews: turn them on in a project's Previews, and every merge request opened from a branch of a project that the source environment builds gets a preview, redeployed on every push and removed with its data when the merge request is merged or closed.
- Forks: merge requests from forks never get a preview, so code from outside the project never runs on your servers.
Disconnecting
Disconnect GitLab removes the webhooks Orbit added and forgets the token. Applications keep their source and can be connected again later, but they stop deploying on push.