1
0
Fork 0
mirror of https://github.com/docker/setup-buildx-action.git synced 2024-11-25 13:01:57 +00:00

Override the configured builder instance

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2021-01-04 19:03:58 +01:00
parent daf8c4fb8d
commit 0ddb9e80d4
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
4 changed files with 14 additions and 6 deletions

View file

@ -22,7 +22,7 @@ jobs:
matrix:
buildx-version:
- latest
- v0.2.2
- v0.4.1
- ""
steps:
-
@ -183,7 +183,7 @@ jobs:
matrix:
buildx-version:
- latest
- v0.2.2
- v0.4.1
- ""
qemu-platforms:
- all

View file

@ -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);

6
dist/index.js generated vendored
View file

@ -557,7 +557,11 @@ function run() {
yield exec.exec('docker', createArgs);
core.endGroup();
core.startGroup(`🏃 Booting builder`);
yield exec.exec('docker', ['buildx', 'inspect', '--bootstrap']);
let bootstrapArgs = ['buildx', 'inspect', '--bootstrap'];
if (semver.satisfies(buildxVersion, '>=0.4.0')) {
bootstrapArgs.push('--builder', builderName);
}
yield exec.exec('docker', bootstrapArgs);
core.endGroup();
}
if (inputs.install) {

View file

@ -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();
}