buildx: remove install method from main module
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -88,14 +88,6 @@ describe('certsDir', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('install', () => {
|
|
||||||
it('acquires buildx v0.9.1', async () => {
|
|
||||||
const buildx = new Buildx({context: new Context()});
|
|
||||||
const buildxBin = await buildx.install('v0.9.1', tmpDir);
|
|
||||||
expect(fs.existsSync(buildxBin)).toBe(true);
|
|
||||||
}, 100000);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('isAvailable', () => {
|
describe('isAvailable', () => {
|
||||||
it('docker cli', async () => {
|
it('docker cli', async () => {
|
||||||
const execSpy = jest.spyOn(exec, 'getExecOutput');
|
const execSpy = jest.spyOn(exec, 'getExecOutput');
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import * as semver from 'semver';
|
|||||||
import {Docker} from '../docker';
|
import {Docker} from '../docker';
|
||||||
import {Context} from '../context';
|
import {Context} from '../context';
|
||||||
import {Inputs} from './inputs';
|
import {Inputs} from './inputs';
|
||||||
import {Install} from './install';
|
|
||||||
|
|
||||||
import {Cert} from '../types/buildx';
|
import {Cert} from '../types/buildx';
|
||||||
|
|
||||||
@@ -34,7 +33,6 @@ export interface BuildxOpts {
|
|||||||
export class Buildx {
|
export class Buildx {
|
||||||
private readonly context: Context;
|
private readonly context: Context;
|
||||||
private _version: string | undefined;
|
private _version: string | undefined;
|
||||||
private _install: Install;
|
|
||||||
|
|
||||||
public readonly inputs: Inputs;
|
public readonly inputs: Inputs;
|
||||||
public readonly standalone: boolean;
|
public readonly standalone: boolean;
|
||||||
@@ -43,7 +41,6 @@ export class Buildx {
|
|||||||
this.context = opts.context;
|
this.context = opts.context;
|
||||||
this.inputs = new Inputs(this.context);
|
this.inputs = new Inputs(this.context);
|
||||||
this.standalone = opts?.standalone ?? !Docker.isAvailable;
|
this.standalone = opts?.standalone ?? !Docker.isAvailable;
|
||||||
this._install = new Install({standalone: opts.standalone});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static get configDir(): string {
|
static get configDir(): string {
|
||||||
@@ -61,10 +58,6 @@ export class Buildx {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public async install(version: string, dest: string): Promise<string> {
|
|
||||||
return await this._install.install(version, dest);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async isAvailable(): Promise<boolean> {
|
public async isAvailable(): Promise<boolean> {
|
||||||
const cmd = this.getCommand([]);
|
const cmd = this.getCommand([]);
|
||||||
return await exec
|
return await exec
|
||||||
|
|||||||
Reference in New Issue
Block a user