mirror of
https://github.com/docker/actions-toolkit.git
synced 2024-11-26 22:26:08 +08:00
buildx: expose methods
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
fdc8b5d37b
commit
14581244a3
@ -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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user