Files
backstage/plugins/events-backend-module-gitlab
Patrick Jungermann 63f7983398 feat(events/gitlab): add GitLabEventRouter
Add an event router for GitLab
which handles events from the topic `gitlab`
and re-publishes events under their more specific topic
based on the `$.event_name` payload field
like e.g., `gitlab.push`.

Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
2022-11-12 01:14:29 +01:00
..

events-backend-module-gitlab

Welcome to the events-backend-module-gitlab backend plugin!

This plugin is a module for the events-backend backend plugin and extends it with an GitlabEventRouter.

The event router will subscribe to the topic gitlab and route the events to more concrete topics based on the value of the provided $.event_name payload field.

Examples:

$.event_name topic
push gitlab.push
merge_request gitlab.merge_request

Please find all possible webhook event types at the official documentation.

Installation

Install the events-backend plugin.

Install this module:

# From your Backstage root directory
yarn add --cwd packages/backend @backstage/plugin-events-backend-module-gitlab

Add the event router to the EventsBackend:

+const gitlabEventRouter = new GitlabEventRouter();

 EventsBackend
+  .addPublishers(gitlabEventRouter)
+  .addSubscribers(gitlabEventRouter);
// [...]