feat(plugins/techdocs): add TechdocsGeneratorExtensionPoint
Signed-off-by: secustor <sebastian@poxhofer.at>
This commit is contained in:
@@ -30,6 +30,8 @@ import {
|
||||
Generators,
|
||||
Publisher,
|
||||
techdocsBuildsExtensionPoint,
|
||||
techdocsGeneratorExtensionPoint,
|
||||
TechdocsGenerator,
|
||||
} from '@backstage/plugin-techdocs-node';
|
||||
import Docker from 'dockerode';
|
||||
import { createRouter } from '@backstage/plugin-techdocs-backend';
|
||||
@@ -51,6 +53,17 @@ export const techdocsPlugin = createBackendPlugin({
|
||||
},
|
||||
});
|
||||
|
||||
let customTechdosGenerator: TechdocsGenerator | undefined;
|
||||
env.registerExtensionPoint(techdocsGeneratorExtensionPoint, {
|
||||
setTechdocsGenerator(generator: TechdocsGenerator) {
|
||||
if (customTechdosGenerator) {
|
||||
throw new Error('TechdocsGenerator may only be set once');
|
||||
}
|
||||
|
||||
customTechdosGenerator = generator;
|
||||
},
|
||||
});
|
||||
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.rootConfig,
|
||||
@@ -76,6 +89,7 @@ export const techdocsPlugin = createBackendPlugin({
|
||||
const generators = await Generators.fromConfig(config, {
|
||||
logger: winstonLogger,
|
||||
containerRunner,
|
||||
customGenerator: customTechdosGenerator,
|
||||
});
|
||||
|
||||
// Publisher is used for
|
||||
|
||||
Reference in New Issue
Block a user