I am new to backstage and I am trying to retrieve with GitLabDiscovery the GitLab-Repos of my company to store them in the catalog of backstage. But it does not work and there are no results in the catalog.
Here is my configuration:
app-config.yaml:
integrations:
gitlab:
- host: ${GIT_LAB_BASE_URL}
token: ${GITLAB_TOKEN}
apiBaseUrl: https://${GITLAB_BASE_URL}/api/v4
catalog:
rules:
- allow: [Components, System, API, Resource, Location]
providers:
gitlab:
ourId:
host: ${GIT_LAB_BASE_URL}
schedule:
frequency: { minutes: 1 }
timeout: { minutes: 3 }
packages/backend/src/plugins/catalog.ts
import { GitlabDiscoveryEntityProvider } from '@backstage/plugin-catalog-backend-module-gitlab';
import { CatalogBuilder } from '@backstage/plugin-catalog-backend';
import { ScaffolderEntitiesProcessor } from '@backstage/plugin-scaffolder-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
const builder = await CatalogBuilder.create(env);
builder.addEntityProvider(
...GitlabDiscoveryEntityProvider.fromConfig(env.config, {
logger: env.logger,
scheduler: env.scheduler,
}),
);
builder.addProcessor(new ScaffolderEntitiesProcessor());
const {processingEngine, router } = await builder.build();
await processingEngine.start();
return router;
}
What I have done so far:
Does someone has an idea? Thanks in advance!
I found my error. I had used the wrong GitLab token.