Skip to main content

Connecting self-hosted GitLab instances

Abstract

For Workspaces, Bitrise supports connecting to self-hosted GitLab instances. Once it’s done, you can add apps to Bitrise from privately hosted repositories.

For Workspaces, Bitrise supports connecting to self-hosted GitLab instances. Connecting is simple, and once it’s done, you can add projects to Bitrise from privately hosted repositories. All functions that you got used to with publicly hosted repositories will be available!

Bitrise needs to be authorized as an application for the entire GitLab instance and then the Application Id and the Secret value belonging to the Bitrise OAuth application must be added to the Workspace on bitrise.io.

Configuring the GitLab connection

To access privately hosted GitLab repositories on Bitrise, you need to create a new OAuth application on your GitLab account, and assign the appropriate credentials to access your server.

Publicly resolvable IP address

Your self-hosted GitLab instance must have a publicly resolvable IP address, otherwise Bitrise won’t be able to connect to it.

  1. Log in to your GitLab instance with root privileges. If you connect to Bitrise without root privileges, your Workspace’s other team members will not have access to the repository on the GitLab instance.

  2. Go to the admin area by clicking the little wrench icon on the top menu bar.

  3. On the left menu bar, select Applications, then click New Application.

    New Application
  4. In the Name field, enter a name that clearly identifies the application. For the sake of simplicity, we recommend Bitrise.

  5. In the Callback URL field, enter https://app.bitrise.io/users/auth/gitlab/callback.

  6. In the Scopes menu, check api.

    New Application settings
  7. Set the Confidential option to No.

    If the newly created app is configured to be confidential, Bitrise won't be able to access it!

  8. Click Submit. On the next page, you should find the Application Id and a Secret. You’ll need both to connect to your GitLab instance on bitrise.io.

    Connecting self-hosted GitLab instances
  9. Log in to Bitrise and select your Workspace.

  10. On the left, select Integrations.

  11. Find the Self-hosted GitLab section.

    self-hosted-gitlab.png
  12. Add your self-hosted GitLab credentials:

    • App ID

    • Secret

    • Self-hosted URL

You are done! Now you are able to access your privately hosted repositories with Bitrise.

Adding a new project from a self-hosted GitLab repository

  1. Start the process of adding a new project.

  2. When prompted to select your Git provider, select GitLab. Select the Self-hosted option.

  3. Click Connect.

Once connected, proceed as usual: Adding a new project.Adding a new project