Skip to content

Commit

Permalink
Merge pull request #32 from crazy-max/group-log-output
Browse files Browse the repository at this point in the history
Group log output
  • Loading branch information
CrazyMax authored and GitHub committed Oct 20, 2020
2 parents 55b445e + f9ddc94 commit dc5191e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
14 changes: 10 additions & 4 deletions dist/index.js

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

14 changes: 10 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ async function run(): Promise<void> {
const dockerConfigHome: string = process.env.DOCKER_CONFIG || path.join(os.homedir(), '.docker');

if (!(await buildx.isAvailable()) || inputs.version) {
core.startGroup(`👉 Installing Buildx`);
await buildx.install(inputs.version || 'latest', dockerConfigHome);
core.endGroup();
}

const buildxVersion = await buildx.getVersion();
Expand All @@ -31,7 +33,7 @@ async function run(): Promise<void> {
stateHelper.setBuilderName(builderName);

if (inputs.driver !== 'docker') {
core.info('🔨 Creating a new builder instance...');
core.startGroup(`🔨 Creating a new builder instance`);
let createArgs: Array<string> = ['buildx', 'create', '--name', builderName, '--driver', inputs.driver];
if (semver.satisfies(buildxVersion, '>=0.3.0')) {
let hasImageDriverOpt: boolean = false;
Expand All @@ -56,20 +58,24 @@ async function run(): Promise<void> {
createArgs.push(inputs.endpoint);
}
await exec.exec('docker', createArgs);
core.endGroup();

core.info('🏃 Booting builder...');
core.startGroup(`🏃 Booting builder`);
await exec.exec('docker', ['buildx', 'inspect', '--bootstrap']);
core.endGroup();
}

if (inputs.install) {
core.info('🤝 Setting buildx as default builder...');
core.startGroup(`🤝 Setting buildx as default builder`);
await exec.exec('docker', ['buildx', 'install']);
core.endGroup();
}

core.info('🛒 Extracting available platforms...');
core.startGroup(`🛒 Extracting available platforms`);
const platforms = await buildx.platforms();
core.info(`${platforms}`);
core.setOutput('platforms', platforms);
core.endGroup();
} catch (error) {
core.setFailed(error.message);
}
Expand Down

0 comments on commit dc5191e

Please sign in to comment.