mirror of
https://github.com/docker/bake-action.git
synced 2026-03-04 07:32:46 +01:00
Remove os limitation
This commit is contained in:
17
src/main.ts
17
src/main.ts
@@ -1,4 +1,3 @@
|
||||
import * as os from 'os';
|
||||
import * as buildx from './buildx';
|
||||
import * as context from './context';
|
||||
import * as core from '@actions/core';
|
||||
@@ -6,27 +5,27 @@ import * as exec from '@actions/exec';
|
||||
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
if (os.platform() !== 'linux') {
|
||||
core.setFailed('Only supported on linux platform');
|
||||
return;
|
||||
}
|
||||
core.startGroup(`Docker info`);
|
||||
await exec.exec('docker', ['version']);
|
||||
await exec.exec('docker', ['info']);
|
||||
core.endGroup();
|
||||
|
||||
if (!(await buildx.isAvailable())) {
|
||||
core.setFailed(`Buildx is required. See https://github.com/docker/setup-buildx-action to set up buildx.`);
|
||||
core.setFailed(`Docker buildx is required. See https://github.com/docker/setup-buildx-action to set up buildx.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const buildxVersion = await buildx.getVersion();
|
||||
core.info(`📣 Buildx version: ${buildxVersion}`);
|
||||
core.info(`Using buildx ${buildxVersion}`);
|
||||
|
||||
let inputs: context.Inputs = await context.getInputs();
|
||||
const args: string[] = await context.getArgs(inputs, buildxVersion);
|
||||
|
||||
core.startGroup(`💡 Bake definition`);
|
||||
core.startGroup(`Bake definition`);
|
||||
await exec.exec('docker', [...args, '--print']);
|
||||
core.endGroup();
|
||||
|
||||
core.info(`🏃 Building...`);
|
||||
core.info(`Building...`);
|
||||
await exec.exec('docker', args);
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
|
||||
Reference in New Issue
Block a user