| Provider | Repositories | A new one goes to | The agent's tools | Push webhook |
|---|---|---|---|---|
| GitHub | https://github.com/owner/repo | Your account or an organization | gh, with GH_TOKEN | Repository webhook, HMAC signature |
| GitLab | https://gitlab.com/group/sub/repo, or your own GitLab | Your namespace or a group / subgroup | glab, with GITLAB_TOKEN (and GITLAB_HOST when self-managed) | Project hook on the deploy branch, secret token |
| Bitbucket Cloud | https://bitbucket.org/workspace/repo | A workspace, or one of its projects | Larapilot's REST client, with BITBUCKET_ACCESS_TOKEN; no CLI | Repository webhook on repo:push, HMAC signature |
| Azure DevOps | https://dev.azure.com/org/project/_git/repo | A project of the organization | az repos (Azure CLI + azure-devops), with AZURE_DEVOPS_EXT_PAT | Service hook on git.push, secret header |
The installer asks for the host of the first administrator's token, with the address of a self-managed GitLab or
the Azure DevOps organization, checks the token there (it becomes their first account) and installs that host's
CLI; the CLI of another host is installed the first time a workspace on it needs it. In every workspace the token of the person's
account on the repository's host is in the
environment three ways: for git, through the askpass helper and with the user name the provider expects
(x-access-token, oauth2, x-bitbucket-api-token-auth); for the CLI; and for
Larapilot's integration. A repository Studio creates gets that integration turned on in its first commit
(larapilot:settings-set --gitlab=YES and so on); in an existing repository the team turns it on once and
commits .larapilot/config.yaml.
Service accounts#
A project site is cloned, given its push webhook and deployed with one git account. An administrator's own token works, but it goes when they leave. In Administration → Connectors → Git hosting administrators keep the team's own tokens instead: a bot user, a project or group access token. Service accounts create repositories, register the webhooks and deploy the sites, whoever the administrator is. They are offered first in the new-project form and in the project's Settings → General → Deployed with. Nobody commits with them: people work with their own accounts. A service account that deploys projects cannot be removed until those projects use another one. Its token needs the administrators' scopes below.
GitHub#
Organizations. A new repository goes to your account or to an organization you belong to; the form lists the organizations your token can see, and creating a repository there needs the right to do so in that organization. Organizations that restrict fine-grained tokens approve them in Organization settings → Personal access tokens. With SAML single sign-on, a classic token must be authorized for the organization (Configure SSO next to the token).
- Where. GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens → Generate new token.
- Resource owner. The organization that owns the projects, or your account. A fine-grained token
reaches one owner: when projects live in several organizations, use a classic token with
repo,read:organdadmin:repo_hook. - Repository access. The repositories of the projects, or all of them; administrators who create repositories need all of them.
- Permissions, everyone. Contents read and write, Pull requests read and write, Metadata read.
- Permissions, administrators. Also Administration read and write (new repositories) and Webhooks read and write (the deploy webhook).
GitLab#
Groups. A new repository goes to your personal namespace or to a group or subgroup where you are at
least Developer and the group lets that role create projects; the form lists those groups by their full path. A
self-managed GitLab is the address given with the account (https://git.example.com; the installer's
STUDIO_GIT_URL for the first administrator's), and the agent's glab gets it as
GITLAB_HOST. Registering the deploy webhook needs the Maintainer role
on the repository.
- Where. On your GitLab: avatar → Edit profile → Access tokens → Add new token.
- Scope.
api: clone and push, merge requests throughglaband Larapilot, and for administrators the new repositories and the webhook.read_repositoryandwrite_repositoryalone let git work, not merge requests. - Expiration. GitLab asks for a date. Replace the token in Studio before it expires.
- Copy it into Settings → Accounts → Git → Add an account → GitLab. It starts with
glpat-.
Bitbucket Cloud#
Workspaces and projects. A Bitbucket repository belongs to a workspace and to one of its projects. The form lists the workspaces you belong to and their projects: a workspace alone puts the repository in its oldest project, a project puts it there. Creating repositories needs a workspace role that allows it; registering the webhook needs admin rights on the repository.
- Where. id.atlassian.com → Account settings → Security → Create and manage API tokens →
Create API token with scopes → Bitbucket. API tokens replace app passwords: git signs in with the token as
x-bitbucket-api-token-auth, the REST API with the token as a bearer. - Scopes, everyone.
read:user,read:workspace,read:repository,write:repository,read:pullrequest,write:pullrequest(each ends in:bitbucket). - Scopes, administrators. Also
read:project,admin:repository(new repositories),read:webhook,write:webhookanddelete:webhook(the deploy webhook). - Expiration. Up to a year. Replace the token in Studio before it expires.
Azure DevOps#
Organization and projects. An Azure DevOps account belongs to one organization, given with the
account (https://dev.azure.com/acme; acme.visualstudio.com addresses work too; the
installer's STUDIO_GIT_URL for the first administrator's). Another organization is another account.
Repositories live in the organization's projects: the form lists them, and a new repository follows the visibility
of its project. A project's address must be in the organization of the account that creates or deploys it. Creating repositories needs the Create
repository permission on the project; registering the push service hook needs Project Administrator.
- Where.
https://dev.azure.com/<organization>→ User settings → Personal access tokens → New Token. - Organization. This Studio's, or all accessible organizations.
- Scopes, everyone. Custom defined → Code → Read & write.
- Scopes, administrators. Code → Read, write & manage, and Project and Team → Read.
- Expiration. At most a year, or less when the organization's policy says so.
The login on Azure DevOps is the account's e-mail address; the handle is its first part
(maria.rossi@acme.com → maria-rossi).