Skip to main content

GitLab

BeetleboxCI supports other git providers such as Gitlab. This includes local installations of Gitlab as well as the online version of Gitlab. You can use SSH keys or username/password authentication in order link your code repositories to your installation of BeetleboxCI.

Adding a Public Gitlab Repository to BeetleboxCI

  1. On the pipelines page of BeetleboxCI in your browser: If you do not already have any pipelines in BeetleboxCI, click 'Create your first pipeline'. Otherwise, click "Create Pipeline" at the bottom of the pipelines page.
  2. In the following screen, fill in the following:
  • Project Name: [Name of your Gitlab repository]

  • Repository URL: https://gitlab.com/<group_name>/<repo_name>

    The authentication settings can be left blank since they are not necessary when adding a public repository.

  1. Click proceed. You will now be redirected to the pipelines page where you can see the project that you just created.

Adding a Private Gitlab Repository to BeetleboxCI

When you add a project from a private repository to BeetleboxCI, you will need to provide either:

  • A Gitlab username and access token (https authentication)
  • A private SSH key to BeetleboxCI (plus adding the public key to Gitlab)

You can find more information further down this page about how to create personal access tokens and set up SSH keys.

  1. On the pipelines page of BeetleboxCI in your browser: If you do not already have any pipelines in BeetleboxCI, click 'Create your first pipeline'. Otherwise, click "Create Pipeline" at the bottom of the pipelines page.
  2. In the following screen, fill in the following:
  • Project Name: [Name of your Gitlab repository]
  • Repository URL: https://gitlab.com/<group_name>/<repo_name> or git@gitlab.com:<username>/<repo_name>
  1. Also fill in either the "Authentication settings" section OR the "SSH Authentication" section. You will need need to use username and token authentication if you chose the https URL or SSH authentication if you chose the SSH URL.
  • Authentication Settings — Username: <Gitlab username>
  • Authentication Settings — Password: <Gitlab personal access token>
  • SSH Authentication — SSH private key
  1. Click proceed. You will now be redirected to the pipelines page where you can see the project that you just created.

Create a Gitlab Access Token

  1. On the Gitlab website, click the account symbol on the top right of the page and click Edit profile.
  2. Click Access Tokens on the left hand sidebar.
  3. Under Token name, enter a name that you can use to easily identify the token.
  4. Set an expiration date for the token. You can leave this blank if you wish.
  5. Select the appropriate permissions for the token, such that it would be possible to read repositories.
  6. Click Create personal access token
  7. Your personal access token will appear like this: **************. Click the eye next to it to reveal the token. Note down the token somewhere safe, since you will not be able to see it again

SSH Keys

Generate an SSH Key

These commands are identical for both Windows and Linux.

  1. Open a terminal in Linux or Powershell in Windows.

  2. Input the command below, replacing the email address with the email that you have registered on Gitlab:

    ssh-keygen -t ed25519 -C "your_email@example.com"
  1. You will be prompted to enter a location to save the key. Press Enter to accept the default location which is shown.
  2. When prompted, enter a secure passphrase.
  3. Now two files will have been generated, and you can browse to the location where you saved them in Step 3 to find them. The file ending in .pub contains the public key which will need to be added as a deploy key either to you Gitlab account or just to a Gitlab repository. The private key can be added during the pipeline creation process in BeetleboxCI, as a means of authentication.

More information generating SSH keys for Gitlab can be found on this link.

Add a public key to your Gitlab account

This will allow access to all the repositories which your account is able to access.

  1. On the Gitlab website, click the account symbol on the top right of the page and click Edit profile.

  2. Click SSH keys on the left hand sidebar.

  3. Copy and paste the public key into the box labelled Key.

    The public key will be similar to:

    ssh-ed25529 M3AGUEr7YVcArc00zSx3WWfY0Kxkb4tNL3BE8020XRwcrE6MBtUXQsKHab3rZt4qSEF62Z user@example.com

  4. Enter a name for the key in the box labelled Title

  5. For the usage type, select Authentication (or Authentication and Signing if you intend to use this key for signing too).

  6. Set an expiration date for the key. You may leave it blank if you wish.

  7. Click Add key.