mirror of
https://github.com/docker/setup-buildx-action.git
synced 2025-07-20 05:28:21 +02:00
Support to retain cache
Signed-off-by: Balaji Arun <balajia@vt.edu>
This commit is contained in:
parent
3f1544eb9e
commit
4143b5899b
6 changed files with 88 additions and 11 deletions
|
@ -25,12 +25,13 @@ export interface Inputs {
|
|||
append: string;
|
||||
cacheBinary: boolean;
|
||||
cleanup: boolean;
|
||||
keepState: boolean;
|
||||
}
|
||||
|
||||
export async function getInputs(): Promise<Inputs> {
|
||||
return {
|
||||
version: core.getInput('version'),
|
||||
name: await getBuilderName(core.getInput('driver') || 'docker-container'),
|
||||
name: await getBuilderName(core.getInput('name'), core.getInput('driver') || 'docker-container'),
|
||||
driver: core.getInput('driver') || 'docker-container',
|
||||
driverOpts: Util.getInputList('driver-opts', {ignoreComma: true, quote: false}),
|
||||
buildkitdFlags: core.getInput('buildkitd-flags'),
|
||||
|
@ -42,12 +43,16 @@ export async function getInputs(): Promise<Inputs> {
|
|||
buildkitdConfigInline: core.getInput('buildkitd-config-inline') || core.getInput('config-inline'),
|
||||
append: core.getInput('append'),
|
||||
cacheBinary: core.getBooleanInput('cache-binary'),
|
||||
cleanup: core.getBooleanInput('cleanup')
|
||||
cleanup: core.getBooleanInput('cleanup'),
|
||||
keepState: core.getBooleanInput('keep-state')
|
||||
};
|
||||
}
|
||||
|
||||
export async function getBuilderName(driver: string): Promise<string> {
|
||||
return driver == 'docker' ? await Docker.context() : `builder-${crypto.randomUUID()}`;
|
||||
export async function getBuilderName(name: string, driver: string): Promise<string> {
|
||||
if (driver == 'docker') {
|
||||
return await Docker.context();
|
||||
}
|
||||
return name || `builder-${crypto.randomUUID()}`;
|
||||
}
|
||||
|
||||
export async function getCreateArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue