Gitlab integration

What is GitLab?

GitLab is a web-based Git repository manager with a set of various tools for software development. It lets developers host, manage and collaborate on their code with the help of code review, issue tracking, and merge request features.

Adding your GitLab repositories in Buddy allows you to create CI/CD pipelines and automatically perform deployment steps defined in them. You can e.g. set up a pipeline that will build, test and deliver your app on every push to your GitLab repository.

On top of that, you can run commands and operations in GitLab directly from Buddy using the GitLab CLI action.

Warning
The GitLab CLI action works only with the personal access token integration type.

Setting up a GitLab integration

  1. Go to the Integrations tab and click New integration.
  2. Look up and click GitLab (you can find it in the Git section):

Image loading...GitLab integration selectionGitLab integration selection

  1. When the configuration window shows up, provide the integration name and select the authorization method:

Image loading...GitLab integration configurationGitLab integration configuration

Hint
You can adjust the privacy settings of your integration (i.e. who can use it and where) in the Sharing tab.
  1. Once everything is set, click Add a new integration to finish the configuration.

OAuth authorization

  1. In the integration configuration window, select OAuth as authorization method and click Start OAuth authorization:

Image loading...GitLab OAuth authorization configurationGitLab OAuth authorization configuration

  1. Log in to your GitLab account and authorize Buddy to use it:

Image loading...GitLab authorization screenGitLab authorization screen

Personal access token authorization

  1. Go to https://gitlab.com/-/profile/personal_access_tokens or click Generate Token in the configuration window.
  2. Click Add new token.
  3. Provide token name, expiration date and select the appropriate scopes:

Image loading...Personal access token configuration in GitLabPersonal access token configuration in GitLab

Hint
By default, the expiry date can be a maximum of 365 days later than the current date. If you do not enter an expiry date, it is automatically set to 365 days later than the current date.
  1. Copy the generated token and paste it in the integration window in Buddy.

What is GitLab EE/CE?

GitLab Enterprise Edition and Community Edition are two different distributions of this repository manager tool. GitLab CE is the free, open-source version suitable for smaller teams and individual developers, while GitLab EE is the paid, commercial version with additional features and enterprise support.

Connecting your GL repositories with Buddy lets you interact with them and fetch code, run tests and deploy your application based on the triggers defined in the pipeline.

Setting up a GitLab EE/CE integration

  1. When setting up the integration for the first time, open the Integrations tab and click New integration.
  2. Look up and click GitLab EE/CE (you can find it in the Git section):

Image loading...GitLab EE/CE integration selectionGitLab EE/CE integration selection

  1. The configuration window will show up:

Image loading...GitLab EE/CE integration configurationGitLab EE/CE integration configuration

Here you have to provide:

  • GitLab Enterprise IP or URL
  • Personal access token
Hint
You can adjust the privacy settings of your integration (i.e. who can use it and where) in the Sharing tab.
  1. Once done, click Add a new integration to add the integration to your roster.

Obtaining GitLab Enterprise personal access token

  1. In GitLab, click on your avatar and select Edit profile:

Image loading...User profile location in GitLabUser profile location in GitLab

  1. In the left menu, go to the Access Tokens tab and click Add new token:

Image loading...Obtaining personal access token from GitLabObtaining personal access token from GitLab

  1. Enter a name and expiry date for the token.
Hint
By default, the expiry date can be a maximum of 365 days later than the current date. If you do not enter an expiry date, it is automatically set to 365 days later than the current date.
  1. Select the desired scopes.
  2. Click Create personal access token, copy it and paste it in the configuration window in Buddy:

Image loading...GitLab EE/CE personal access token authorization configurationGitLab EE/CE personal access token authorization configuration

That’s it! You have synchronized GitLab with Buddy. You can now add a GitLab project and begin with creating your continuous integration pipeline.

Hint
Last update:
Sep 23, 2024