ServerAvatarDocs
Integrations

Git accounts

Connect GitHub, GitLab or Bitbucket once, then deploy applications on any server from its repositories.

A Git account lets ServerAvatar read your repositories and branches and add the deploy webhook, so an application can be deployed from a repository. ServerAvatar never pushes code. You connect an account once for the organization. Then you choose it when you create an application on any server. Open Git under Integrations in the organization's sidebar.

  1. Open the organization and select Git in the sidebar, in the Integrations group.

    The Git page with no account connected, the three steps to get started and a Connect account button

The page lists the Connected accounts: "Accounts applications can deploy from." With none, it explains three steps: pick your Git provider, create a token there that can read your repositories and add webhooks, and choose the account when you create an application.

Connect an account

  1. Select Connect account.

    The Connect a Git account dialog with the choices GitHub, GitLab and Bitbucket

  2. Choose where your code lives: GitHub (github.com), GitLab (gitlab.com, or your own server) or Bitbucket (bitbucket.org).

    The Connect GitLab dialog with the Name, GitLab address and Access token fields

  3. Enter a Name, for example "Company GitHub". It is shown when you pick an account for a new application.

  4. For GitLab, enter the GitLab address if you use your own GitLab. Leave it empty for gitlab.com. For Bitbucket, enter the Workspace whose repositories you deploy.

  5. Paste the Access token. The link Create a token on provider opens the provider's page for it. The token needs these permissions:

    ProviderGive the token
    GitHubThe repo and admin:repo_hook scopes.
    GitLabThe api and read_repository scopes.
    BitbucketRead access to repositories and webhooks.
  6. Select Connect account. ServerAvatar checks the token with the provider before it saves it. You see "Git account connected."

A GitHub fine-grained token has no scopes: its access is set per repository on GitHub.

Check an account

Each account in Connected accounts shows its name, the provider, the username (or the GitLab address or Bitbucket workspace) and a badge: Working, with when it was Last checked, or Not working. The information icon shows the Access (the scopes the provider reported), the workspace, when it was last checked and when it was connected.

  • Check connection asks the provider whether the token still works. You see "name is connected." or "name needs a new token."
  • Check repository access tests whether the token can reach a repository. It says "Repository access confirmed.", "No repositories found for this account." (create a repository, or make sure the token can reach an existing one) or "Could not check repository access." The result is shown under the account and not saved.

Replace a token

An account shows Not working when the provider refused its token. "The token was revoked or deleted at provider. Create a new one and replace the current token."

  1. Select Replace token (on the account, or in the account menu).
  2. Paste the New access token. ServerAvatar checks it first. If the provider refuses it, the saved token stays.
  3. Select Check & save. You see "New token saved for name."

Servers that use the account get the new token automatically.

Edit or disconnect an account

Open the account menu (Account actions) on the account.

  • Edit: rename the account, or change its GitLab address or Bitbucket workspace, then select Save. The token stays as it is.
  • Disconnect: ServerAvatar removes the account. "This only removes the account from ServerAvatar. Nothing changes at provider; to stop the token working, revoke it there." Confirm with Disconnect. You see "Git account disconnected."

An account used on a server cannot be disconnected. Remove it from those servers first.

Accounts on servers

Under an account, Not on a server yet means no server has it. Otherwise a link such as 2 servers opens Servers using name. An account is put on a server when you choose it for an application on that server. ServerAvatar adds it to the server's panel ("Git account added to server.").

When you edit the account or replace its token, the servers that have it are updated in the background. Each server shows a status: Updating…, Updated or Not updated, with counts such as "1 not updated".

  • Update again tries once more on a server that shows Not updated.
  • Remove from server deletes the account from that server. "name is deleted from this server. Applications there that deploy with it must use another account first." Applications that still deploy with it block the removal.

Control Panel customers manage their own Git accounts on their server. Those are not the organization's accounts shown here.

Limits

  • Name: required, up to 100 characters. Every account in the organization has its own name.
  • Access token: 8 to 500 characters, letters, digits and symbols, with no spaces.
  • GitLab address: up to 255 characters, an https:// address, and a public one. A private or local address is refused.
  • Workspace (Bitbucket): required, up to 100 characters, letters, digits and ., _ and -.
  • The same token cannot be connected twice in an organization.
  • A token is checked with the provider before it is saved. It is stored encrypted and never shown again.

Who can do this

  • Seeing the accounts needs View on Git (organization.integrations.git). Connecting, editing, replacing a token, checking, disconnecting and managing the servers of an account need Manage. With view only the page says "You can see the accounts but not change them."
  • Changes need a normal login. The personal API token can read the accounts, their servers and repositories, but cannot change them. See API reference.
  • Each change is recorded in the organization's activity log, for example "Connected Git account name (provider)." and "Added Git account name (provider) to server server."

Common errors

  • The provider rejected this token. Check that it is correct, has not expired or been revoked, and can read repositories.
  • The provider could not find this account. Check the GitLab address or the Bitbucket workspace.
  • The GitLab address must be a public HTTPS address. and The GitLab address could not be found (DNS lookup failed). Check the address for typos.
  • The provider is receiving too many requests. Wait a minute and try again.
  • The provider could not be reached right now. Please try again later.
  • This token is already connected in this organization as "name". and Another Git account in this organization already has this name.
  • This Git account is still used on these servers: names. Remove it from those servers first.
  • Applications on this server still deploy with this Git account, so it can't be removed there. Move those applications to another account first.
  • The server could not be reached. Try again when it is online.
  • The saved token of this Git account cannot be read. Edit the account and save the token again.
  • This Git account was changed by someone else meanwhile. Reload it and try again.

On this page