Skip to main content

Adding a GitLab webhook

Abstract

You can specify webhooks on Gitlab so that Bitrise automatically triggers a build of your app whenever you perform a specified action, such as a code push or a pull request.

You can set up webhooks so that Bitrise automatically triggers a build of your app whenever you perform a specified action, such as a code push or a pull request. For GitLab, all you have to do is register your bitrise-webhooks URL as a Webhook in your GitLab repository.

In addition, you can take advantage of Git Insights. Git Insights enables you to quantify and optimize Git collaboration. It provides crucial metrics like pull request cycle time and merge frequency.

You can register a webhook either automatically or manually. This guide walks you through the process of manually registering a webhook.

  1. Open your app on Bitrise with a user that has the Admin role on the app.

  2. On the main page of the app, click on the App Settings icon: settings.svg.

    app-settings.png
  3. On the left, select Integrations.

  4. Click Set up webhooks manually.

  5. In the pop-up window, select GitLab from the dropdown menu.

    apps-webhooks-select.png
  6. Copy the webhook URL.

  7. Open your project on GitLab.com

  8. Go to Settings of the project.

  9. Select Webhooks and then click Add new webhook.

  10. Enter the bitrise-webhooks URL in the URL field.

    Adding a Gitlab webhook
  11. In the Trigger section select:

    • Push events

    • Tag push events

    • Merge request events

    • Comments

    Adding a Gitlab webhook
  12. Click Add webhook.

That’s all! The next time you push code, push a new tag or create/update a merge request a build will be triggered (if you have Trigger mapping defined for the event(s) on Bitrise).