Skip to main content
Version: QB13

Working with GitLab

QuickBuild integrates with GitLab via the GitLab repository. This repository has all features of a normal Git repository, but add the ability to build against merge requests, and update merge request status based on build result.

Build against merge requests

To build against GitLab merge requests, define a GitLab repository like below:

In repository definition, you may select to build against merge requests with filter, and then you can add your criteria in format: a=value1&b=value2

You need also specify the private access token in order to build against merge requests. The private access token should have permission to access to APIs and the repo.

See more detailed information on below page:

https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html

GitLab Webhook Integration

QuickBuild can trigger builds via GitLab webhooks since 9.0.

Config GitLab

To enable the webhook, first you need go to GitLab repository webhook settings page to configure the QuickBuild side related information:

see more detailed information on webhooks below:

https://docs.gitlab.com/ee/user/project/integrations/webhooks.html

Config QuickBuild

Add anonymous group

As the webhook is triggered without authentication, anonymous group should be added and it should have the permission to use RESTful API.

Add webhook settings

QuickBuild only allow push event to trigger the builds, other events will be ignored. To add integration at QuickBuild side, please go to configuration settings page and then choose Webhook -> GitLab from right side menu:

Then, you can add the settings:

  • Trigger User the user to trigger the build
  • Webhook Secret the secret should be the same as what you defined in GitLab
  • Trigger Condition the trigger condition in Groovy scripts, when the result is true, build will be triggered, otherwise, the build will not be triggered.