Gitlab Plugin

This topic describes how to configure the Digital.ai Release Gitlab plugin.

Prerequisites

  • Install the Gitlab plugin into the XLR plugins/xlr-official folder.

Requirements

  • Gitlab server compatible with api v4
  • Digital.ai Release running and accessible.

Configuration

  • You need to have information about URL and personal access token to connect with Gitlab server.
  • Create a Shared Configuration for your Gitlab Server.

Set up a Connection to the Gitlab Server

  1. In the top navigation bar, click on Settings > Shared configuration.
  2. Under configurations, beside Gitlab: Server, click Add button
  3. Enter the name for the configuration in the Title field.
  4. Enter the URL in URL field, where the Gitlab server is running.
  5. Enter the personal access token in the API Token field.
  6. In API Token, enter the personal access token.
  7. Click on Test, to test the connection.
  8. Click on Save, to save the configuration.

XLR_gitlab_CONNECTION

Features

  • Gitlab triggers - This trigger can be used to poll the Gitlab for triggering releases.

    • Gitlab commit trigger.
    • Gitlab tag trigger.
  • Tasks of Gitlab

    • Gitlab: Accept Merge Request
    • Gitlab: Create Branch
    • Gitlab: Create Group
    • Gitlab: Create Merge Request
    • Gitlab: Create Project
    • Gitlab: Create Project Webhook
    • Gitlab: Create Tag
    • Gitlab: Query Commits
    • Gitlab: Query Data
    • Gitlab: Query Merge Requests
    • Gitlab: Query Pipelines
    • Gitlab: Query Project
    • Gitlab: Query Secure Data
    • Gitlab: Query Tags
    • Gitlab: Trigger Pipeline
  • Webhooks event for Gitlab.
  • Gitlab tiles on the release dashboard.

Set up a Connection for Commit Webhook

  1. In your Gitlab instance add a webhook
  2. Select Push events
  3. Specify the Release url as: http://username:password@xlrserver:port/api/extension/gitlab/commit_webhook?template=<templateName/prefix>
  4. The following variables are available to be used in Release:

    • project_name
    • repofullname
    • branch_name
    • commit_message
    • currentcommithash

XLR_commit_webhooks_CONNECTION

Set up a Connection for Merge Request Webhook

  1. In your Gitlab instance add a webhook
  2. Select Push events
  3. Specify the Release url as: http://username:password@xlrserver:port/api/extension/gitlab/pr_webhook?template=<templateName/prefix>
  4. The following variables are available to be used in Release:

    • pullrequestnumber
    • pullrequesttitle
    • repository_name
    • proj_name
    • source_hash
    • source_branch
    • source_project
    • source_repo
    • target_branch
    • target_project
    • target_repo

XLR_commit_webhooks_CONNECTION

Tile and Dashboard Configuration

There are seven tiles available:

  • GitLab Commits Tile
  • GitLab Contributions Tile
  • GitLab Merge Requests Tile
  • GitLab Pipelines Tile
  • GitLab Pipeline Trends
  • GitLab Tags Timeline Tile
  • GitLab Timeline Tile
  • In the top navigation bar, click Reports.
  • Select the dashboard where you want to add the new tile.

    Note: If you have not created a dashboard yet, click on Add dashboard on the top right of the screen to create dashboard.

  • In the top right of the screen, click Configure dashboard.
  • In the top right of the screen, click Add tiles.
  • Hover over GitLab Commits Tile, and click on Add.
  • Click on Configure option present in the tile.
  • Enter a name for the tile in the Title field.
  • Select the server configured in the Gitlab Server field.
  • Enter the project key in the Project ID field.
  • Enter the name of branch from where data can be fetched in the Branch Name field.
  • Enter the limit of list in numbers, in the Results Limit field.
  • Click on Save.

You can configure the rest of the tiles using the same process described above.

XLR_Dashboard_server_CONNECTION

Release Notes

Release Gitlab Plugin 10.1.0

  • [ENG-4551] - Initial Release/Insourcing.