Skip to content

Commit

Permalink
Use --builder
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Sep 3, 2020
1 parent b563df0 commit cf9301c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 27 deletions.
19 changes: 4 additions & 15 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions src/buildx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,3 @@ export async function parseVersion(stdout: string): Promise<string> {
}
return semver.clean(matches[1]);
}

export async function use(builder: string): Promise<void> {
return await exec.exec(`docker`, ['buildx', 'use', '--builder', builder], false).then(res => {
if (res.stderr != '' && !res.success) {
throw new Error(res.stderr);
}
});
}
3 changes: 3 additions & 0 deletions src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ async function getCommonArgs(inputs: Inputs): Promise<Array<string>> {
if (inputs.noCache) {
args.push('--no-cache');
}
if (inputs.builder) {
args.push('--builder', inputs.builder);
}
if (inputs.pull) {
args.push('--pull');
}
Expand Down
4 changes: 0 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ async function run(): Promise<void> {
core.info(`📣 Buildx version: ${buildxVersion}`);

let inputs: context.Inputs = await context.getInputs();
if (inputs.builder) {
core.info(`📌 Using builder instance ${inputs.builder}`);
await buildx.use(inputs.builder);
}

core.info(`🏃 Starting build...`);
const args: string[] = await context.getArgs(inputs, buildxVersion);
Expand Down

0 comments on commit cf9301c

Please sign in to comment.