Skip to content

Commit

Permalink
Merge pull request #49 from crazy-max/bootstrap-builder
Browse files Browse the repository at this point in the history
Override the configured builder instance
  • Loading branch information
crazy-max committed Jan 4, 2021
2 parents daf8c4f + 0ddb9e8 commit 370507b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
matrix:
buildx-version:
- latest
- v0.2.2
- v0.4.1
- ""
steps:
-
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:
matrix:
buildx-version:
- latest
- v0.2.2
- v0.4.1
- ""
qemu-platforms:
- all
Expand Down
4 changes: 2 additions & 2 deletions __tests__/buildx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ describe('platforms', () => {

describe('install', () => {
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'setup-buildx-'));
it('acquires v0.2.2 version of buildx', async () => {
const buildxBin = await buildx.install('v0.2.2', tmpDir);
it('acquires v0.4.1 version of buildx', async () => {
const buildxBin = await buildx.install('v0.4.1', tmpDir);
console.log(buildxBin);
expect(fs.existsSync(buildxBin)).toBe(true);
}, 100000);
Expand Down
6 changes: 5 additions & 1 deletion dist/index.js

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

6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ async function run(): Promise<void> {
core.endGroup();

core.startGroup(`🏃 Booting builder`);
await exec.exec('docker', ['buildx', 'inspect', '--bootstrap']);
let bootstrapArgs: Array<string> = ['buildx', 'inspect', '--bootstrap'];
if (semver.satisfies(buildxVersion, '>=0.4.0')) {
bootstrapArgs.push('--builder', builderName);
}
await exec.exec('docker', bootstrapArgs);
core.endGroup();
}

Expand Down

0 comments on commit 370507b

Please sign in to comment.