Log In

Connect Repositories

Updated on 06 May 2024

You can connect the repository with your application’s code to our App Platform when creating a new app in the Hostman control panel.

The App Platform supports GitLab, GitHub and BitBucket repositories, as well as any repositories that can be accessed by URL, including Gitea, self-hosted GitLab, GitHub Enterprise repositories, etc.

Connect a repository from GitLab, GitHub or BitBucket

To connect the repository:

  1. Go to the App Platform section and click Create.

  2. At the Repository step, click on the platform icon.

Image1

  1. Log in to your account.

  2. Allow access to the required repositories.

  3. Select the repository for deployment in the Hostman dashboard.

If you're already logged into your GitHub, GitLab, or Bitbucket account, Hostman will automatically display the available repositories. All you have to do is select the one you need.

If you are logged in, but the required repository is not available:

  1. Click Add Account.

  2. Choose a platform.

  3. Log in if necessary.

  4. Select the required repositories and save the changes.

Then select the desired repository for deployment in the Hostman dashboard.

Connect a repository via URL

You can connect any repository to the App platform that has an external HTTP or HTTPS address, including repositories from self-hosted GitLab, GitHub Enterprise, or repositories hosted by providers that we do not directly support (for example, Gitea).

The option can also be used for security purposes: if you do not want to give access to the entire Git account, you can only add a specific repository using a link.

Please note that automatic deployment will not be available for repositories connected via URL. After updating the code, you will need to deploy the application manually selecting the desired commit. 

For public repositories, providing a URL is enough. 

For private repositories, you will need to provide login and password for the account or a token that is generated in the provider interface (GitLab, GitHub, etc.).

Connect a repository

You can connect the repository with URL when creating a new application:

  1. Go to the App Platform section and click Create.

  2. In the Repository step, click Connect the repository via URL.

  3. Provide the URL to the repository and access details if the repository is private.

  4. Click Connect.

The repository and available commits will be displayed in the control panel.

Get a git link

The connection link must be in Git URL format, for example:

https://github.com/hostman/app-example.git

In GitHub you can get the required link by clicking on Code HTTPS.

The same in GitLab or BitBucket: go to the desired repository → click on Code/Clone Clone with HTTPS.

Get a link and token in BitBucket

There are two ways to get a token and link in BitBucket.

Method 1.

  1. Go to Personal Bitbucket settings → App password.

Image5

  1. Set the name (Label) and permissions; Read permissions are sufficient.

Image9

  1. Click Create.

  2. Copy the password and paste it into the Password or token field in the Hostman dashboard.

  3. Go to the repository and click Clone. Copy everything that comes after git clone and paste it into the Repository URL field.

Image3

  1. Copy the part of the link between https:// and @ and paste it into the Username field.

Method 2.

  1. Go to Settings Repository settingsAccess tokenCreate Repository Access Token.

  2. Set the name and permissions (Scopes). Permissions to read repositories are sufficient.

Image7

  1. Copy the value from the Your Repository Access Token field and paste it into the Password or token field in the Hostman dashboard. 

Image6

  1. As a link to the repository, use the URL from the How to use this token with your Git repository field. Copy everything that comes after git clone and paste it into the Repository URL field in the Hostman dashboard.  

Image2

Get a token on GitHub

You won't be able to connect a GitHub repository using your account password; for this you need a token.

To generate a token in GitHub:

  1. Go to Settings Developer SettingsPersonal access tokensTokens Generate a personal access token.

  2. Set the token name, expiration date, and permissions. To work with private repositories, you need to select repo.

Ff398dec 0574 429b B03b 83d82255b920

  1. Click Generate token.

  2. Copy the token and paste it into the Password or token field in the Hostman dashboard.

Get a token in GitLab

To connect GitLab repositories, you can use your account password or token generated in your GitLab account settings.

  1. Go to Preferences Access Tokens.

  2. Create a new token, specifying its name, expiration date, and permissions. At a minimum, you will need permission to read repositories.

  3. Click Create personal access token.

  4. Copy the token and paste it into the Password or token field in the Hostman dashboard.

Remove connected repositories

Any added repository can be unlinked from the App platform. 

If you unlink a repository, any deployments (both automatic and manual) of all applications created from this repository will become impossible.

  1. Go to the App Platform section and click Create.

  2. Go to the Repository step. Click on the drop-down list of repositories and click Delete next to the repository you wish to remove.

  3. Confirm the action.

App Platform does not display the required repository

If your GitHub, Gitlab or Bitbucket account is connected to the App platform, but the required repository is not displayed in the Hostman dashboard control panel, there may be two reasons:

  • You added the repository after you had logged into your GitHub, Gitlab, or Bitbucket account from the App platform.

  • You allowed access to only certain repositories, and the required repository is not selected.

To solve the problem:

  1. Go to the App Platform section and click Create.

  2. Go to the Repository step and click Add account.

  3. Choose a platform.

  4. Log in if necessary.

  5. Select the desired repository and save your changes.

4af4dc64 6e3c 4908 8d14 Bf418eb10cda

Connected repositories will appear in the Hostman dashboard, and you can select the one you need.

Was this page helpful?

Share