mirror of
https://github.com/docker/setup-buildx-action.git
synced 2024-11-23 06:56:07 +08:00
do not remove builder using the docker driver
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
f549413411
commit
85ce96bcbc
@ -60,6 +60,7 @@ actionsToolkit.run(
|
|||||||
|
|
||||||
core.setOutput('name', inputs.name);
|
core.setOutput('name', inputs.name);
|
||||||
stateHelper.setBuilderName(inputs.name);
|
stateHelper.setBuilderName(inputs.name);
|
||||||
|
stateHelper.setBuilderDriver(inputs.driver);
|
||||||
|
|
||||||
fs.mkdirSync(Buildx.certsDir, {recursive: true});
|
fs.mkdirSync(Buildx.certsDir, {recursive: true});
|
||||||
stateHelper.setCertsDir(Buildx.certsDir);
|
stateHelper.setCertsDir(Buildx.certsDir);
|
||||||
@ -169,7 +170,7 @@ actionsToolkit.run(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stateHelper.builderName.length > 0) {
|
if (stateHelper.builderDriver != 'docker' && stateHelper.builderName.length > 0) {
|
||||||
await core.group(`Removing builder`, async () => {
|
await core.group(`Removing builder`, async () => {
|
||||||
const buildx = new Buildx({standalone: stateHelper.standalone});
|
const buildx = new Buildx({standalone: stateHelper.standalone});
|
||||||
const rmCmd = await buildx.getCommand(['rm', stateHelper.builderName]);
|
const rmCmd = await buildx.getCommand(['rm', stateHelper.builderName]);
|
||||||
|
@ -3,6 +3,7 @@ import * as core from '@actions/core';
|
|||||||
export const IsDebug = !!process.env['STATE_isDebug'];
|
export const IsDebug = !!process.env['STATE_isDebug'];
|
||||||
export const standalone = /true/i.test(process.env['STATE_standalone'] || '');
|
export const standalone = /true/i.test(process.env['STATE_standalone'] || '');
|
||||||
export const builderName = process.env['STATE_builderName'] || '';
|
export const builderName = process.env['STATE_builderName'] || '';
|
||||||
|
export const builderDriver = process.env['STATE_builderDriver'] || '';
|
||||||
export const containerName = process.env['STATE_containerName'] || '';
|
export const containerName = process.env['STATE_containerName'] || '';
|
||||||
export const certsDir = process.env['STATE_certsDir'] || '';
|
export const certsDir = process.env['STATE_certsDir'] || '';
|
||||||
export const cleanup = /true/i.test(process.env['STATE_cleanup'] || '');
|
export const cleanup = /true/i.test(process.env['STATE_cleanup'] || '');
|
||||||
@ -19,6 +20,10 @@ export function setBuilderName(builderName: string) {
|
|||||||
core.saveState('builderName', builderName);
|
core.saveState('builderName', builderName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function setBuilderDriver(builderDriver: string) {
|
||||||
|
core.saveState('builderDriver', builderDriver);
|
||||||
|
}
|
||||||
|
|
||||||
export function setContainerName(containerName: string) {
|
export function setContainerName(containerName: string) {
|
||||||
core.saveState('containerName', containerName);
|
core.saveState('containerName', containerName);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user