Configure Gitlab
In this guide, we will explore how to configure GitSync using Gitlab as the repository manager. By default GitSync is configured for the master branch.
Setting up Gitlab in Paybill​
Role Required: Admin
-
Create a New Repository
Create a new repository on your Gitlab. The repository can be public or private. You can also use an existing repository. Make sure that the repository is empty. -
Obtain the SSH URL
When a repository is created, Gitlab shows a screen with the SSH URL. -
Go to the Admin settings, and click on the Configure git tab.
(Example URL -https://my-company.paybill.dev/_admin/configure-git
) -
Enter the SSH URL of the repository in the Git repo URL field.
-
Click on the Generate SSH key button, and copy the SSH key that is generated. The SSH key is used to authenticate Paybill with the repository.
There are two types of generated SSH keys:
- ED25519: This is a secure and efficient algorithm that is used for generating SSH keys. It is recommended to use this key type. VCS providers like GitHub and GitLab recommend using this key type
- RSA: This is an older algorithm that is used for generating SSH keys. It is not recommended to use this key type. Providers like Bitbucket recommend using this key type.
You have two options for adding the SSH key to GitLab, you can either add it globally to access all your repositories or deploy it for a specific repository.
Option 1: Add as a User-Wide SSH Key​
Use this option for access to all your repositories.
-
Click on your avatar in the top-left corner and select Edit Profile.
-
Navigate to the SSH Keys tab and click the Add new key button.
-
In the Key field, paste the SSH key you generated from the Paybill.
-
Give your key a descriptive title.
-
Set Usage type to Authentication & signing.
-
Optionally, set an expiration date.
-
Click Add key to save.
Option 2: Add as a Deploy Key​
Use this option for access to a specific repository only.
-
Navigate to the repository you want to add the key to.
-
Click on the Settings tab and select Repository.
-
Once you are in the Repository Settings, expand the Deploy Keys section.
-
Click on the Add new deploy key button.
-
Give your key a descriptive title.
-
In the Key field, paste the SSH key you generated in Paybill's Configure Git tab during the previous step.
-
Enable the Grant write permissions to this key checkbox. We need this permission to push changes to the repository.
-
Click Add key to save.
-
After deploying the SSH Key, go to the Configure git tab on Paybill, and click on the Finalize setup button. If the SSH key is configured correctly, you will see a success message.