mirror of
https://github.com/docker/actions-toolkit.git
synced 2024-11-26 22:26:08 +08:00
buildx: certsDir
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
5e365b5a48
commit
b223e0a42b
@ -68,6 +68,24 @@ describe('configDir', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('certsDir', () => {
|
||||
const originalEnv = process.env;
|
||||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
process.env = {
|
||||
...originalEnv,
|
||||
BUILDX_CONFIG: '/var/docker/buildx'
|
||||
};
|
||||
});
|
||||
afterEach(() => {
|
||||
process.env = originalEnv;
|
||||
});
|
||||
it('returns default', async () => {
|
||||
process.env.BUILDX_CONFIG = '/var/docker/buildx';
|
||||
expect(Buildx.certsDir).toEqual(path.join('/var/docker/buildx', 'certs'));
|
||||
});
|
||||
});
|
||||
|
||||
describe('isAvailable', () => {
|
||||
it('docker cli', async () => {
|
||||
const execSpy = jest.spyOn(exec, 'getExecOutput');
|
||||
|
@ -47,6 +47,10 @@ export class Buildx {
|
||||
return process.env.BUILDX_CONFIG || path.join(Docker.configDir, 'buildx');
|
||||
}
|
||||
|
||||
static get certsDir(): string {
|
||||
return path.join(Buildx.configDir, 'certs');
|
||||
}
|
||||
|
||||
public getCommand(args: Array<string>) {
|
||||
return {
|
||||
command: this.standalone ? 'buildx' : 'docker',
|
||||
|
Loading…
Reference in New Issue
Block a user