Merge pull request #5372 from backstage/mob/catalog-refactor

Initial iteration of the next software catalog
This commit is contained in:
Patrik Oldsberg
2021-04-20 11:44:44 +02:00
committed by GitHub
19 changed files with 2128 additions and 2 deletions
+27
View File
@@ -18,6 +18,7 @@ import { useHotCleanup } from '@backstage/backend-common';
import {
CatalogBuilder,
createRouter,
NextCatalogBuilder,
runPeriodically,
} from '@backstage/plugin-catalog-backend';
import { Router } from 'express';
@@ -26,6 +27,32 @@ import { PluginEnvironment } from '../types';
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
/*
* ** WARNING **
* DO NOT enable the experimental catalog, it will brick your database migrations.
* This is solely for internal backstage development.
*/
if (process.env.EXPERIMENTAL_CATALOG === '1') {
const builder = new NextCatalogBuilder(env);
const {
entitiesCatalog,
locationsCatalog,
locationAnalyzer,
processingEngine,
} = await builder.build();
// TODO(jhaals): run and manage in background.
processingEngine.start();
return await createRouter({
entitiesCatalog,
locationsCatalog,
locationAnalyzer,
logger: env.logger,
config: env.config,
});
}
const builder = new CatalogBuilder(env);
const {
entitiesCatalog,