mirror of
https://github.com/docker/setup-buildx-action.git
synced 2025-04-22 16:06:36 +02:00
switch to actions-toolkit implementation
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
2dd22fa31c
commit
987520896f
28 changed files with 209 additions and 1271 deletions
|
@ -1,88 +0,0 @@
|
|||
import {describe, expect, test, beforeEach} from '@jest/globals';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import * as auth from '../src/auth';
|
||||
|
||||
const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-setup-buildx-jest')).split(path.sep).join(path.posix.sep);
|
||||
const dockerConfigHome = path.join(tmpdir, '.docker');
|
||||
const credsdir = path.join(dockerConfigHome, 'buildx', 'creds');
|
||||
|
||||
describe('setCredentials', () => {
|
||||
beforeEach(() => {
|
||||
process.env = Object.keys(process.env).reduce((object, key) => {
|
||||
if (!key.startsWith(auth.envPrefix)) {
|
||||
object[key] = process.env[key];
|
||||
}
|
||||
return object;
|
||||
}, {});
|
||||
});
|
||||
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
[
|
||||
'mycontext',
|
||||
'docker-container',
|
||||
{},
|
||||
[],
|
||||
[]
|
||||
],
|
||||
[
|
||||
'docker-container://mycontainer',
|
||||
'docker-container',
|
||||
{},
|
||||
[],
|
||||
[]
|
||||
],
|
||||
[
|
||||
'tcp://graviton2:1234',
|
||||
'remote',
|
||||
{},
|
||||
[],
|
||||
[]
|
||||
],
|
||||
[
|
||||
'tcp://graviton2:1234',
|
||||
'remote',
|
||||
{
|
||||
'BUILDER_NODE_0_AUTH_TLS_CACERT': 'foo',
|
||||
'BUILDER_NODE_0_AUTH_TLS_CERT': 'foo',
|
||||
'BUILDER_NODE_0_AUTH_TLS_KEY': 'foo'
|
||||
},
|
||||
[
|
||||
path.join(credsdir, 'cacert_graviton2-1234.pem'),
|
||||
path.join(credsdir, 'cert_graviton2-1234.pem'),
|
||||
path.join(credsdir, 'key_graviton2-1234.pem')
|
||||
],
|
||||
[
|
||||
`cacert=${path.join(credsdir, 'cacert_graviton2-1234.pem')}`,
|
||||
`cert=${path.join(credsdir, 'cert_graviton2-1234.pem')}`,
|
||||
`key=${path.join(credsdir, 'key_graviton2-1234.pem')}`
|
||||
]
|
||||
],
|
||||
[
|
||||
'tcp://graviton2:1234',
|
||||
'docker-container',
|
||||
{
|
||||
'BUILDER_NODE_0_AUTH_TLS_CACERT': 'foo',
|
||||
'BUILDER_NODE_0_AUTH_TLS_CERT': 'foo',
|
||||
'BUILDER_NODE_0_AUTH_TLS_KEY': 'foo'
|
||||
},
|
||||
[
|
||||
path.join(credsdir, 'cacert_graviton2-1234.pem'),
|
||||
path.join(credsdir, 'cert_graviton2-1234.pem'),
|
||||
path.join(credsdir, 'key_graviton2-1234.pem')
|
||||
],
|
||||
[]
|
||||
],
|
||||
])('given %p endpoint', async (endpoint: string, driver: string, envs: Record<string, string>, expectedFiles: Array<string>, expectedOpts: Array<string>) => {
|
||||
fs.mkdirSync(credsdir, {recursive: true});
|
||||
for (const [key, value] of Object.entries(envs)) {
|
||||
process.env[key] = value;
|
||||
}
|
||||
expect(auth.setCredentials(credsdir, 0, driver, endpoint)).toEqual(expectedOpts);
|
||||
expectedFiles.forEach( (file) => {
|
||||
expect(fs.existsSync(file)).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,261 +0,0 @@
|
|||
import {describe, expect, it, jest, test} from '@jest/globals';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import * as buildx from '../src/buildx';
|
||||
import * as context from '../src/context';
|
||||
import * as semver from 'semver';
|
||||
import * as exec from '@actions/exec';
|
||||
|
||||
const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-setup-buildx-')).split(path.sep).join(path.posix.sep);
|
||||
jest.spyOn(context, 'tmpDir').mockImplementation((): string => {
|
||||
return tmpdir;
|
||||
});
|
||||
|
||||
const tmpname = path.join(tmpdir, '.tmpname').split(path.sep).join(path.posix.sep);
|
||||
jest.spyOn(context, 'tmpNameSync').mockImplementation((): string => {
|
||||
return tmpname;
|
||||
});
|
||||
|
||||
describe('isAvailable', () => {
|
||||
const execSpy = jest.spyOn(exec, 'getExecOutput');
|
||||
buildx.isAvailable();
|
||||
|
||||
// eslint-disable-next-line jest/no-standalone-expect
|
||||
expect(execSpy).toHaveBeenCalledWith(`docker`, ['buildx'], {
|
||||
silent: true,
|
||||
ignoreReturnCode: true
|
||||
});
|
||||
});
|
||||
|
||||
describe('isAvailable standalone', () => {
|
||||
const execSpy = jest.spyOn(exec, 'getExecOutput');
|
||||
buildx.isAvailable(true);
|
||||
|
||||
// eslint-disable-next-line jest/no-standalone-expect
|
||||
expect(execSpy).toHaveBeenCalledWith(`buildx`, [], {
|
||||
silent: true,
|
||||
ignoreReturnCode: true
|
||||
});
|
||||
});
|
||||
|
||||
describe('getVersion', () => {
|
||||
it('valid', async () => {
|
||||
const version = await buildx.getVersion();
|
||||
expect(semver.valid(version)).not.toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('parseVersion', () => {
|
||||
test.each([
|
||||
['github.com/docker/buildx 0.4.1+azure bda4882a65349ca359216b135896bddc1d92461c', '0.4.1'],
|
||||
['github.com/docker/buildx v0.4.1 bda4882a65349ca359216b135896bddc1d92461c', '0.4.1'],
|
||||
['github.com/docker/buildx v0.4.2 fb7b670b764764dc4716df3eba07ffdae4cc47b2', '0.4.2'],
|
||||
['github.com/docker/buildx f117971 f11797113e5a9b86bd976329c5dbb8a8bfdfadfa', 'f117971']
|
||||
])('given %p', async (stdout, expected) => {
|
||||
expect(buildx.parseVersion(stdout)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('satisfies', () => {
|
||||
test.each([
|
||||
['0.4.1', '>=0.3.2', true],
|
||||
['bda4882a65349ca359216b135896bddc1d92461c', '>0.1.0', false],
|
||||
['f117971', '>0.6.0', true]
|
||||
])('given %p', async (version, range, expected) => {
|
||||
expect(buildx.satisfies(version, range)).toBe(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('inspect', () => {
|
||||
it('valid', async () => {
|
||||
const builder = await buildx.inspect('');
|
||||
expect(builder).not.toBeUndefined();
|
||||
expect(builder.name).not.toEqual('');
|
||||
expect(builder.driver).not.toEqual('');
|
||||
expect(builder.nodes).not.toEqual({});
|
||||
}, 100000);
|
||||
});
|
||||
|
||||
describe('parseInspect', () => {
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
[
|
||||
'inspect1.txt',
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "builder-5cb467f7-0940-47e1-b94b-d51f54054d620",
|
||||
"endpoint": "unix:///var/run/docker.sock",
|
||||
"status": "running",
|
||||
"buildkitd-flags": "--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host",
|
||||
"buildkit": "v0.10.4",
|
||||
"platforms": "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/amd64/v4,linux/arm64,linux/riscv64,linux/386,linux/arm/v7,linux/arm/v6"
|
||||
}
|
||||
],
|
||||
"name": "builder-5cb467f7-0940-47e1-b94b-d51f54054d62",
|
||||
"driver": "docker-container"
|
||||
}
|
||||
],
|
||||
[
|
||||
'inspect2.txt',
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "builder-5f449644-ff29-48af-8344-abb0292d06730",
|
||||
"endpoint": "unix:///var/run/docker.sock",
|
||||
"driver-opts": [
|
||||
"image=moby/buildkit:latest"
|
||||
],
|
||||
"status": "running",
|
||||
"buildkitd-flags": "--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host",
|
||||
"buildkit": "v0.10.4",
|
||||
"platforms": "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/amd64/v4,linux/386"
|
||||
}
|
||||
],
|
||||
"name": "builder-5f449644-ff29-48af-8344-abb0292d0673",
|
||||
"driver": "docker-container"
|
||||
}
|
||||
],
|
||||
[
|
||||
'inspect3.txt',
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "builder-9929e463-7954-4dc3-89cd-514cca29ff800",
|
||||
"endpoint": "unix:///var/run/docker.sock",
|
||||
"driver-opts": [
|
||||
"image=moby/buildkit:master",
|
||||
"network=host"
|
||||
],
|
||||
"status": "running",
|
||||
"buildkitd-flags": "--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host",
|
||||
"buildkit": "3fab389",
|
||||
"platforms": "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/amd64/v4,linux/386"
|
||||
}
|
||||
],
|
||||
"name": "builder-9929e463-7954-4dc3-89cd-514cca29ff80",
|
||||
"driver": "docker-container"
|
||||
}
|
||||
],
|
||||
[
|
||||
'inspect4.txt',
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "default",
|
||||
"endpoint": "default",
|
||||
"status": "running",
|
||||
"buildkit": "20.10.17",
|
||||
"platforms": "linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6"
|
||||
}
|
||||
],
|
||||
"name": "default",
|
||||
"driver": "docker"
|
||||
}
|
||||
],
|
||||
[
|
||||
'inspect5.txt',
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "aws_graviton2",
|
||||
"endpoint": "tcp://1.23.45.67:1234",
|
||||
"driver-opts": [
|
||||
"cert=/home/user/.certs/aws_graviton2/cert.pem",
|
||||
"key=/home/user/.certs/aws_graviton2/key.pem",
|
||||
"cacert=/home/user/.certs/aws_graviton2/ca.pem"
|
||||
],
|
||||
"status": "running",
|
||||
"platforms": "darwin/arm64,linux/arm64,linux/arm/v5,linux/arm/v6,linux/arm/v7,windows/arm64"
|
||||
}
|
||||
],
|
||||
"name": "remote-builder",
|
||||
"driver": "remote"
|
||||
}
|
||||
],
|
||||
[
|
||||
'inspect6.txt',
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "builder-17cfff01-48d9-4c3d-9332-9992e308a5100",
|
||||
"endpoint": "unix:///var/run/docker.sock",
|
||||
"status": "running",
|
||||
"buildkitd-flags": "--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host",
|
||||
"platforms": "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/386"
|
||||
}
|
||||
],
|
||||
"name": "builder-17cfff01-48d9-4c3d-9332-9992e308a510",
|
||||
"driver": "docker-container"
|
||||
}
|
||||
],
|
||||
])('given %p', async (inspectFile, expected) => {
|
||||
expect(await buildx.parseInspect(fs.readFileSync(path.join(__dirname, 'fixtures', inspectFile)).toString())).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('build', () => {
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'setup-buildx-'));
|
||||
|
||||
// eslint-disable-next-line jest/no-disabled-tests
|
||||
it.skip('builds refs/pull/648/head', async () => {
|
||||
const buildxBin = await buildx.build('https://github.com/docker/buildx.git#refs/pull/648/head', tmpDir, false);
|
||||
expect(fs.existsSync(buildxBin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
// eslint-disable-next-line jest/no-disabled-tests
|
||||
it.skip('builds 67bd6f4dc82a9cd96f34133dab3f6f7af803bb14', async () => {
|
||||
const buildxBin = await buildx.build('https://github.com/docker/buildx.git#67bd6f4dc82a9cd96f34133dab3f6f7af803bb14', tmpDir, false);
|
||||
expect(fs.existsSync(buildxBin)).toBe(true);
|
||||
}, 100000);
|
||||
});
|
||||
|
||||
describe('install', () => {
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'setup-buildx-'));
|
||||
test.each([
|
||||
['v0.4.1', false],
|
||||
['latest', false],
|
||||
['v0.4.1', true],
|
||||
['latest', true]
|
||||
])(
|
||||
'acquires %p of buildx (standalone: %p)',
|
||||
async (version, standalone) => {
|
||||
const buildxBin = await buildx.install(version, tmpDir, standalone);
|
||||
expect(fs.existsSync(buildxBin)).toBe(true);
|
||||
},
|
||||
100000
|
||||
);
|
||||
});
|
||||
|
||||
describe('getConfig', () => {
|
||||
test.each([
|
||||
['debug = true', false, 'debug = true', false],
|
||||
[`notfound.toml`, true, '', true],
|
||||
[
|
||||
`${path.join(__dirname, 'fixtures', 'buildkitd.toml').split(path.sep).join(path.posix.sep)}`,
|
||||
true,
|
||||
`debug = true
|
||||
[registry."docker.io"]
|
||||
mirrors = ["mirror.gcr.io"]
|
||||
`,
|
||||
false
|
||||
]
|
||||
])('given %p config', async (val, file, exValue, invalid) => {
|
||||
try {
|
||||
let config: string;
|
||||
if (file) {
|
||||
config = await buildx.getConfigFile(val);
|
||||
} else {
|
||||
config = await buildx.getConfigInline(val);
|
||||
}
|
||||
expect(true).toBe(!invalid);
|
||||
expect(config).toEqual(tmpname);
|
||||
const configValue = fs.readFileSync(tmpname, 'utf-8');
|
||||
expect(configValue).toEqual(exValue);
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line jest/no-conditional-expect
|
||||
expect(true).toBe(invalid);
|
||||
}
|
||||
});
|
||||
});
|
|
@ -1,19 +1,9 @@
|
|||
import {beforeEach, describe, expect, it, jest, test} from '@jest/globals';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
|
||||
import * as uuid from 'uuid';
|
||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
||||
import {Node} from '@docker/actions-toolkit/lib/types/builder';
|
||||
|
||||
import * as context from '../src/context';
|
||||
import * as nodes from '../src/nodes';
|
||||
|
||||
const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-setup-buildx-')).split(path.sep).join(path.posix.sep);
|
||||
jest.spyOn(context, 'tmpDir').mockImplementation((): string => {
|
||||
return tmpdir;
|
||||
});
|
||||
|
||||
jest.spyOn(context, 'tmpNameSync').mockImplementation((): string => {
|
||||
return path.join(tmpdir, '.tmpname').split(path.sep).join(path.posix.sep);
|
||||
});
|
||||
|
||||
jest.mock('uuid');
|
||||
jest.spyOn(uuid, 'v4').mockReturnValue('9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d');
|
||||
|
@ -146,7 +136,7 @@ describe('getCreateArgs', () => {
|
|||
setInput(name, value);
|
||||
});
|
||||
const inp = await context.getInputs();
|
||||
const res = await context.getCreateArgs(inp, '0.9.0');
|
||||
const res = await context.getCreateArgs(inp, new Toolkit());
|
||||
expect(res).toEqual(expected);
|
||||
}
|
||||
);
|
||||
|
@ -192,86 +182,17 @@ describe('getAppendArgs', () => {
|
|||
]
|
||||
])(
|
||||
'[%d] given %p as inputs, returns %p',
|
||||
async (num: number, inputs: Map<string, string>, node: nodes.Node, expected: Array<string>) => {
|
||||
async (num: number, inputs: Map<string, string>, node: Node, expected: Array<string>) => {
|
||||
inputs.forEach((value: string, name: string) => {
|
||||
setInput(name, value);
|
||||
});
|
||||
const inp = await context.getInputs();
|
||||
const res = await context.getAppendArgs(inp, node, '0.9.0');
|
||||
const res = await context.getAppendArgs(inp, node, new Toolkit());
|
||||
expect(res).toEqual(expected);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe('getInputList', () => {
|
||||
it('handles single line correctly', async () => {
|
||||
await setInput('foo', 'bar');
|
||||
const res = await context.getInputList('foo');
|
||||
expect(res).toEqual(['bar']);
|
||||
});
|
||||
|
||||
it('handles multiple lines correctly', async () => {
|
||||
setInput('foo', 'bar\nbaz');
|
||||
const res = await context.getInputList('foo');
|
||||
expect(res).toEqual(['bar', 'baz']);
|
||||
});
|
||||
|
||||
it('remove empty lines correctly', async () => {
|
||||
setInput('foo', 'bar\n\nbaz');
|
||||
const res = await context.getInputList('foo');
|
||||
expect(res).toEqual(['bar', 'baz']);
|
||||
});
|
||||
|
||||
it('handles comma correctly', async () => {
|
||||
setInput('foo', 'bar,baz');
|
||||
const res = await context.getInputList('foo');
|
||||
expect(res).toEqual(['bar', 'baz']);
|
||||
});
|
||||
|
||||
it('remove empty result correctly', async () => {
|
||||
setInput('foo', 'bar,baz,');
|
||||
const res = await context.getInputList('foo');
|
||||
expect(res).toEqual(['bar', 'baz']);
|
||||
});
|
||||
|
||||
it('handles different new lines correctly', async () => {
|
||||
setInput('foo', 'bar\r\nbaz');
|
||||
const res = await context.getInputList('foo');
|
||||
expect(res).toEqual(['bar', 'baz']);
|
||||
});
|
||||
|
||||
it('handles different new lines and comma correctly', async () => {
|
||||
setInput('foo', 'bar\r\nbaz,bat');
|
||||
const res = await context.getInputList('foo');
|
||||
expect(res).toEqual(['bar', 'baz', 'bat']);
|
||||
});
|
||||
|
||||
it('handles multiple lines and ignoring comma correctly', async () => {
|
||||
setInput('driver-opts', 'image=moby/buildkit:master\nnetwork=host');
|
||||
const res = await context.getInputList('driver-opts', true);
|
||||
expect(res).toEqual(['image=moby/buildkit:master', 'network=host']);
|
||||
});
|
||||
|
||||
it('handles different new lines and ignoring comma correctly', async () => {
|
||||
setInput('driver-opts', 'image=moby/buildkit:master\r\nnetwork=host');
|
||||
const res = await context.getInputList('driver-opts', true);
|
||||
expect(res).toEqual(['image=moby/buildkit:master', 'network=host']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('asyncForEach', () => {
|
||||
it('executes async tasks sequentially', async () => {
|
||||
const testValues = [1, 2, 3, 4, 5];
|
||||
const results: number[] = [];
|
||||
|
||||
await context.asyncForEach(testValues, async value => {
|
||||
results.push(value);
|
||||
});
|
||||
|
||||
expect(results).toEqual(testValues);
|
||||
});
|
||||
});
|
||||
|
||||
// See: https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L67
|
||||
function getInputName(name: string): string {
|
||||
return `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
import {describe, expect, it, jest} from '@jest/globals';
|
||||
import * as docker from '../src/docker';
|
||||
import * as exec from '@actions/exec';
|
||||
|
||||
describe('isAvailable', () => {
|
||||
it('cli', () => {
|
||||
const execSpy = jest.spyOn(exec, 'getExecOutput');
|
||||
docker.isAvailable();
|
||||
|
||||
// eslint-disable-next-line jest/no-standalone-expect
|
||||
expect(execSpy).toHaveBeenCalledWith(`docker`, undefined, {
|
||||
silent: true,
|
||||
ignoreReturnCode: true
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,3 +0,0 @@
|
|||
debug = true
|
||||
[registry."docker.io"]
|
||||
mirrors = ["mirror.gcr.io"]
|
|
@ -1,10 +0,0 @@
|
|||
Name: builder-5cb467f7-0940-47e1-b94b-d51f54054d62
|
||||
Driver: docker-container
|
||||
|
||||
Nodes:
|
||||
Name: builder-5cb467f7-0940-47e1-b94b-d51f54054d620
|
||||
Endpoint: unix:///var/run/docker.sock
|
||||
Status: running
|
||||
Flags: --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
|
||||
Buildkit: v0.10.4
|
||||
Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/arm64, linux/riscv64, linux/386, linux/arm/v7, linux/arm/v6
|
|
@ -1,11 +0,0 @@
|
|||
Name: builder-5f449644-ff29-48af-8344-abb0292d0673
|
||||
Driver: docker-container
|
||||
|
||||
Nodes:
|
||||
Name: builder-5f449644-ff29-48af-8344-abb0292d06730
|
||||
Endpoint: unix:///var/run/docker.sock
|
||||
Driver Options: image="moby/buildkit:latest"
|
||||
Status: running
|
||||
Flags: --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
|
||||
Buildkit: v0.10.4
|
||||
Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/386
|
|
@ -1,11 +0,0 @@
|
|||
Name: builder-9929e463-7954-4dc3-89cd-514cca29ff80
|
||||
Driver: docker-container
|
||||
|
||||
Nodes:
|
||||
Name: builder-9929e463-7954-4dc3-89cd-514cca29ff800
|
||||
Endpoint: unix:///var/run/docker.sock
|
||||
Driver Options: image="moby/buildkit:master" network="host"
|
||||
Status: running
|
||||
Flags: --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
|
||||
Buildkit: 3fab389
|
||||
Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/386
|
|
@ -1,9 +0,0 @@
|
|||
Name: default
|
||||
Driver: docker
|
||||
|
||||
Nodes:
|
||||
Name: default
|
||||
Endpoint: default
|
||||
Status: running
|
||||
Buildkit: 20.10.17
|
||||
Platforms: linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
|
|
@ -1,9 +0,0 @@
|
|||
Name: remote-builder
|
||||
Driver: remote
|
||||
|
||||
Nodes:
|
||||
Name: aws_graviton2
|
||||
Endpoint: tcp://1.23.45.67:1234
|
||||
Driver Options: cert="/home/user/.certs/aws_graviton2/cert.pem" key="/home/user/.certs/aws_graviton2/key.pem" cacert="/home/user/.certs/aws_graviton2/ca.pem"
|
||||
Status: running
|
||||
Platforms: darwin/arm64*, linux/arm64*, linux/arm/v5*, linux/arm/v6*, linux/arm/v7*, windows/arm64*, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/mips64le, linux/mips64
|
|
@ -1,9 +0,0 @@
|
|||
Name: builder-17cfff01-48d9-4c3d-9332-9992e308a510
|
||||
Driver: docker-container
|
||||
|
||||
Nodes:
|
||||
Name: builder-17cfff01-48d9-4c3d-9332-9992e308a5100
|
||||
Endpoint: unix:///var/run/docker.sock
|
||||
Status: running
|
||||
Flags: --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
|
||||
Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/386
|
|
@ -1,9 +0,0 @@
|
|||
import {describe, expect, it} from '@jest/globals';
|
||||
import * as git from '../src/git';
|
||||
|
||||
describe('git', () => {
|
||||
it('returns git remote ref', async () => {
|
||||
const ref: string = await git.getRemoteSha('https://github.com/docker/buildx.git', 'refs/pull/648/head');
|
||||
expect(ref).toEqual('f11797113e5a9b86bd976329c5dbb8a8bfdfadfa');
|
||||
});
|
||||
});
|
|
@ -1,12 +0,0 @@
|
|||
import {describe, expect, test} from '@jest/globals';
|
||||
import * as util from '../src/util';
|
||||
|
||||
describe('isValidUrl', () => {
|
||||
test.each([
|
||||
['https://github.com/docker/buildx.git', true],
|
||||
['https://github.com/docker/buildx.git#refs/pull/648/head', true],
|
||||
['v0.4.1', false]
|
||||
])('given %p', async (url, expected) => {
|
||||
expect(util.isValidUrl(url)).toEqual(expected);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue