Files
backstage/plugins/events-backend-module-bitbucket-cloud/README.md
T
Patrick Jungermann 6bc121bf0d feat(events/bitbucketCloud): add BitbucketCloudEventRouter
Add an event router for Bitbucket Cloud
which handles events from the topic `bitbucketCloud`
and re-publishes events under their more specific topic
based on the `x-event-key` metadata
like e.g., `bitbucketCloud.repo:push`.

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

1.3 KiB

events-backend-module-bitbucket-cloud

Welcome to the events-backend-module-bitbucket-cloud backend plugin!

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

The event router will subscribe to the topic bitbucketCloud and route the events to more concrete topics based on the value of the provided x-event-key metadata field.

Examples:

x-event-key topic
repo:push bitbucketCloud.repo:push
repo:updated bitbucketCloud.repo:updated
pullrequest:created bitbucketCloud.pullrequest:created

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-bitbucket-cloud

Add the event router to the EventsBackend:

+const bitbucketCloudEventRouter = new BitbucketCloudEventRouter();

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