From 087eef7d45f6a86bec0762fa83c25e6c41a01f61 Mon Sep 17 00:00:00 2001 From: Roland Sgs Date: Fri, 5 May 2023 22:03:24 -0300 Subject: [PATCH] Update Integration Gitlab OrgData Just an update to Integrations Gitlab OrgData, once it's not defined the necessary addition to packages/backend/src/plugins/catalog.ts as in all others Signed-off-by: Roland Sgs --- docs/integrations/gitlab/org.md | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/docs/integrations/gitlab/org.md b/docs/integrations/gitlab/org.md index d78b0ed388..9354e68e7e 100644 --- a/docs/integrations/gitlab/org.md +++ b/docs/integrations/gitlab/org.md @@ -11,6 +11,41 @@ groups -- directly from GitLab. The result is a hierarchy of [`Group`](../../features/software-catalog/descriptor-format.md#kind-group) entities that mirrors your org setup. +As this provider is not one of the default providers, you will first need to install the Gitlab provider plugin: + +```bash +# From your Backstage root directory +yarn add --cwd packages/backend @backstage/plugin-catalog-backend-module-gitlab +``` + +Then add the plugin to the plugin catalog `packages/backend/src/plugins/catalog.ts`: + +```ts +/* packages/backend/src/plugins/catalog.ts */ +/* highlight-add-next-line */ +import { GitlabOrgDiscoveryEntityProvider } from '@backstage/plugin-catalog-backend-module-gitlab'; + + +const builder = await CatalogBuilder.create(env); +/** ... other processors and/or providers ... */ +/* highlight-add-start */ + builder.addEntityProvider( + ...GitlabOrgDiscoveryEntityProvider.fromConfig(env.config, { + logger: env.logger, + // optional: alternatively, use scheduler with schedule defined in app-config.yaml + schedule: env.scheduler.createScheduledTaskRunner({ + frequency: { minutes: 30 }, + timeout: { minutes: 3 }, + }), + }), + ); + /* highlight-add-end */ +``` + +## Configuration + +To use the entity provider, you'll need a [Gitlab integration set up](https://backstage.io/docs/integrations/gitlab/locations). + ```yaml integrations: gitlab: