buildx: expose methods

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2023-01-23 15:11:35 +01:00
parent fdc8b5d37b
commit 14581244a3
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
2 changed files with 16 additions and 16 deletions

View File

@ -22,6 +22,14 @@ export class BuildKit {
this.buildx = opts?.buildx || new Buildx(); this.buildx = opts?.buildx || new Buildx();
} }
public tmpDir() {
return this.tmpdir;
}
public tmpName(options?: tmp.TmpNameOptions): string {
return tmp.tmpNameSync(options);
}
private async getBuilderInfo(name: string): Promise<BuilderInfo> { private async getBuilderInfo(name: string): Promise<BuilderInfo> {
const builder = new Builder({buildx: this.buildx}); const builder = new Builder({buildx: this.buildx});
return builder.inspect(name); return builder.inspect(name);
@ -114,12 +122,4 @@ export class BuildKit {
fs.writeFileSync(configFile, s); fs.writeFileSync(configFile, s);
return configFile; return configFile;
} }
private tmpDir() {
return this.tmpdir;
}
private tmpName(options?: tmp.TmpNameOptions): string {
return tmp.tmpNameSync(options);
}
} }

View File

@ -22,6 +22,14 @@ export class Buildx {
this.version = this.getVersion(); this.version = this.getVersion();
} }
public tmpDir() {
return this.tmpdir;
}
public tmpName(options?: tmp.TmpNameOptions): string {
return tmp.tmpNameSync(options);
}
public getCommand(args: Array<string>) { public getCommand(args: Array<string>) {
return { return {
command: this.standalone ? 'buildx' : 'docker', command: this.standalone ? 'buildx' : 'docker',
@ -179,12 +187,4 @@ export class Buildx {
} }
return false; return false;
} }
private tmpDir() {
return this.tmpdir;
}
private tmpName(options?: tmp.TmpNameOptions): string {
return tmp.tmpNameSync(options);
}
} }