techdocs-backend: instantiate containerRunner internally
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
@@ -17,16 +17,11 @@
|
||||
import { resolve } from 'path';
|
||||
import { OptionValues } from 'commander';
|
||||
import fs from 'fs-extra';
|
||||
import Docker from 'dockerode';
|
||||
import {
|
||||
TechdocsGenerator,
|
||||
ParsedLocationAnnotation,
|
||||
getMkdocsYml,
|
||||
} from '@backstage/plugin-techdocs-node';
|
||||
import {
|
||||
ContainerRunner,
|
||||
DockerContainerRunner,
|
||||
} from '@backstage/backend-common';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import {
|
||||
convertTechDocsRefToLocationAnnotation,
|
||||
@@ -75,14 +70,6 @@ export default async function generate(opts: OptionValues) {
|
||||
},
|
||||
});
|
||||
|
||||
// Docker client (conditionally) used by the generators, based on techdocs.generators config.
|
||||
let containerRunner: ContainerRunner | undefined;
|
||||
|
||||
if (opts.docker) {
|
||||
const dockerClient = new Docker();
|
||||
containerRunner = new DockerContainerRunner({ dockerClient });
|
||||
}
|
||||
|
||||
let parsedLocationAnnotation = {} as ParsedLocationAnnotation;
|
||||
if (opts.techdocsRef) {
|
||||
try {
|
||||
@@ -97,7 +84,6 @@ export default async function generate(opts: OptionValues) {
|
||||
// Generate docs using @backstage/plugin-techdocs-node
|
||||
const techdocsGenerator = await TechdocsGenerator.fromConfig(config, {
|
||||
logger,
|
||||
containerRunner,
|
||||
});
|
||||
|
||||
logger.info('Generating documentation...');
|
||||
|
||||
Reference in New Issue
Block a user