Skip to content

GitLab - Usage ​

To use the GitLab plugin, the plugin must be loaded and an instance created before you can configure the plugin integration. You define configuration properties in the user interface or in a JSON file.

Integration type ​

The GitLab plug-in supports scheduled events integration which are listed in the following table.

NameDescription
syncGitLabIssueQueries the GitLab Server for issues in a project.
syncGitLabPullQueries the GitLab Server for merge requests in a project.
syncGitLabCommitQueries the GitLab Server for commits in a project.
syncGitLabBuildQueries the GitLab Server for builds in a project.
Sync Gitlab deploymentsA Gitlab deployments that will occur on a timer
Sync Gitlab PipelinesGitlab Pipeline that will occur on a timer

Integration ​

To install the plug-in, perform the following steps:

  1. In IBM DevOps Velocity, click Settings > Integrations > Available.
  2. In the Action column for the GitLab plug-in, click Install.

There are two methods to integrate the plug-in:

  1. Using the user interface
  2. Using a JSON file

The tables in the Configuration properties describe the properties used to define the integration.

Integrating the plug-in by using user interface ​

To integrate the plug-in using the user interface, perform the following steps:

  1. In IBM DevOps Velocity, click Settings > Integrations > Installed.
  2. In the Action column for the GitLab plug-in, click Add Integration.
  3. On the Add Integration dialog, enter the values for the fields to configure the integration and define communication.
  4. Click Add.

Integrating the plug-in by using JSON file ​

The JSON file contains the information for creating a value stream. Within the JSON file is a section for integrations. It is in this section that plugin properties can be defined. Refer to the JSON sample code in the Configuration Properties section.

To integrate the plug-in using a JSON, perform the following steps:

  1. Navigate to value stream page, and then click the necessary value stream.
  2. Click wrench icon, and then Select Edit value stream, to modify the JSON file in the code or tree view editors. Alternatively, you can also click Download JSON option to download the JSON file, and then select the Import JSON option to upload the revised JSON file.
  3. Edit the integration information in the JSON file to add the plug-in configuration properties. Refer to JSON sample code in the Configuration Properties section more details.
  4. Click Save.

Configuration Properties ​

The following tables describe the properties used to configure the integration. Each table contains the field name when using the user interface and the property name when using a JSON file.

  • The General Configuration Properties table describes configuration properties used by all plugin integrations.
  • The GitLab Configuration Properties table describes the configuration properties that define the connection and communications with the GitLab server.

Some properties might not be displayed in the user interface, to see all properties enable the Show Hidden Properties field.

General Configuration Properties table ​

NameDescriptionRequired
imageThe version of the plug-in that you want to use. To view available versions, see the UrbanCode DockerHub. If a value is not specified, the latest version is used.No
loggingLevelThe level of Log4j messages to display in the log file. Valid values are: all, debug, info, warn, error, fatal, off, and trace.No
nameAn assigned name to the value stream.Yes
propertiesList of configuration properties used to connect and communicate with the GitLab server. Enclose the properties within braces.Yes
tenant_idThe name of the tenant.Yes
typeUnique identifier assigned to the plug-in. The value for the GitLab plug-in is ucv-ext-gitlab.Yes

GitLab Configuration Properties table ​

NameTypeDescriptionRequiredProject Name
URLStringThe URL of the GitLab server.YesbaseUrl
Private TokenSecureThe Gitlab server access token. For more information, see the GitLab documentation at https://gitlab.com/profile/personal_access_tokens.Yesprivate_token
DevOps Velocity User Access KeySecureThe user access key used to authenticate with the DevOps Velocity server.YesucvAccessKey
Priorty Field Mapping using LabelsArrayMap GitLab label for Priorty to this server. The priorty field label must be a key vaule pair connected by “:” or “-“. Example: If Gitlab Label for priorty is priortyKey:High, then pass priortyKey in this field.NofieldMapping
Proxy ServerStringThe URL of the proxy server including the port number.NoproxyServer
Proxy User NameStringThe user name used to authenticate with the proxy server.NoproxyUsername
Proxy PasswordSecureThe password used to authenticate with the proxy server.NoproxyPassword
Project Names (Comma Separated List)ArrayYou can import the source data by providing a list of GitLab Project Names, which can include regular expressions for pattern matching. For instance, you can use wildcards such as * to match any character sequence, such as sample* to match project names that start with sample. Example: sample, sample1, etc.NoprojectNames
Team Space IdFilterableSelectThe Team space associated with the integration.NoteamspaceId
Team IdFilterableSelectThe teams associated with the integration.NoteamId
BranchStringGitLab repositories branch, The branch to pull commits from.NobranchName
Additional Branches (Comma Separated List)ArrayThe name of additional branches to collect commits from besides the main one, leave blank if not needed.NootherBranches

Example ​

The following example can be used as a template to include the GitLab plug-in integration into the JSON file. Copy and paste the template into the JSON file and make the appropriate changes.


"integrations":[
{

"type":"ucv-ext-gitlab",
"tenant_id":"tenantId",
"name":"my-repo",
"disabled":false,

"properties":{
"ucvAccessKey":"key",
"baseUrl":"https://gitlab.com",

"private_token":"token",
"projectIds":[
"8918",
"12345"
],

"proxyServer": "http://localhost:3128",
"proxyUsername": "admin",
"proxyPassword": "1234",

"fieldMapping:[
"priorityKey1",
"priorityKey2"
]
}``
}``
]