fixing techdocs-cli Docker client creation
Docker client does not need to be created when --no-docker option is provided. If you had DOCKER_CERT_PATH environment variable defined the Docker client was looking for certificates and breaking techdocs-cli generate command even with --no-docker option. Signed-off-by: Matteo Silvestri <matteosilv@gmail.com>
This commit is contained in:
@@ -55,7 +55,7 @@ export class TechdocsGenerator implements GeneratorBase {
|
||||
*/
|
||||
public static readonly defaultDockerImage = 'spotify/techdocs:v1.1.0';
|
||||
private readonly logger: Logger;
|
||||
private readonly containerRunner: ContainerRunner;
|
||||
private readonly containerRunner?: ContainerRunner;
|
||||
private readonly options: GeneratorConfig;
|
||||
private readonly scmIntegrations: ScmIntegrationRegistry;
|
||||
|
||||
@@ -77,7 +77,7 @@ export class TechdocsGenerator implements GeneratorBase {
|
||||
|
||||
constructor(options: {
|
||||
logger: Logger;
|
||||
containerRunner: ContainerRunner;
|
||||
containerRunner?: ContainerRunner;
|
||||
config: Config;
|
||||
scmIntegrations: ScmIntegrationRegistry;
|
||||
}) {
|
||||
@@ -143,7 +143,7 @@ export class TechdocsGenerator implements GeneratorBase {
|
||||
);
|
||||
break;
|
||||
case 'docker':
|
||||
await this.containerRunner.runContainer({
|
||||
await this.containerRunner!.runContainer({
|
||||
imageName:
|
||||
this.options.dockerImage ?? TechdocsGenerator.defaultDockerImage,
|
||||
args: ['build', '-d', '/output'],
|
||||
|
||||
@@ -28,7 +28,7 @@ export type GeneratorRunInType = 'docker' | 'local';
|
||||
* @public
|
||||
*/
|
||||
export type GeneratorOptions = {
|
||||
containerRunner: ContainerRunner;
|
||||
containerRunner?: ContainerRunner;
|
||||
logger: Logger;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user