2020-10-25 09:25:23 +08:00
|
|
|
import * as fs from 'fs';
|
|
|
|
import * as path from 'path';
|
|
|
|
import * as dotenv from 'dotenv';
|
2020-10-25 22:13:43 +08:00
|
|
|
import * as moment from 'moment';
|
|
|
|
import {getInputs, Inputs} from '../src/context';
|
2020-10-25 09:25:23 +08:00
|
|
|
import * as github from '../src/github';
|
2020-10-26 08:39:21 +08:00
|
|
|
import {Meta, Version} from '../src/meta';
|
2020-10-25 09:25:23 +08:00
|
|
|
import {Context} from '@actions/github/lib/context';
|
|
|
|
import {ReposGetResponseData} from '@octokit/types';
|
|
|
|
|
|
|
|
jest.spyOn(github, 'repo').mockImplementation(
|
|
|
|
(): Promise<ReposGetResponseData> => {
|
|
|
|
return <Promise<ReposGetResponseData>>require(path.join(__dirname, 'fixtures', 'repo.json'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
jest.spyOn(github, 'context').mockImplementation(
|
|
|
|
(): Context => {
|
|
|
|
return new Context();
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
jest.spyOn(global.Date.prototype, 'toISOString').mockImplementation(() => {
|
|
|
|
return '2020-01-10T00:30:00.000Z';
|
|
|
|
});
|
|
|
|
|
2020-10-25 22:13:43 +08:00
|
|
|
jest.mock('moment', () => {
|
|
|
|
return () => jest.requireActual('moment')('2020-01-10T00:30:00.000Z');
|
|
|
|
});
|
|
|
|
|
2020-10-26 08:39:21 +08:00
|
|
|
beforeEach(() => {
|
|
|
|
Object.keys(process.env).forEach(function (key) {
|
|
|
|
if (key !== 'GITHUB_TOKEN' && key.startsWith('GITHUB_')) {
|
|
|
|
delete process.env[key];
|
|
|
|
}
|
2020-10-25 09:25:23 +08:00
|
|
|
});
|
2020-10-26 08:39:21 +08:00
|
|
|
});
|
|
|
|
|
2021-03-29 19:04:53 +08:00
|
|
|
const tagsLabelsTest = async (name: string, envFile: string, inputs: Inputs, exVersion: Version, exTags: Array<string>, exLabels: Array<string>) => {
|
2020-10-26 08:39:21 +08:00
|
|
|
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
|
|
|
|
const context = github.context();
|
|
|
|
console.log(process.env, context);
|
|
|
|
|
|
|
|
const repo = await github.repo(process.env.GITHUB_TOKEN || '');
|
|
|
|
const meta = new Meta({...getInputs(), ...inputs}, context, repo);
|
|
|
|
|
2020-12-01 12:38:08 +08:00
|
|
|
const version = meta.version;
|
2020-10-26 08:39:21 +08:00
|
|
|
console.log('version', version);
|
|
|
|
expect(version).toEqual(exVersion);
|
|
|
|
|
2021-03-29 19:04:53 +08:00
|
|
|
const tags = meta.getTags();
|
2020-10-26 08:39:21 +08:00
|
|
|
console.log('tags', tags);
|
|
|
|
expect(tags).toEqual(exTags);
|
|
|
|
|
2021-03-29 19:04:53 +08:00
|
|
|
const labels = meta.getLabels();
|
2020-10-26 08:39:21 +08:00
|
|
|
console.log('labels', labels);
|
|
|
|
expect(labels).toEqual(exLabels);
|
|
|
|
};
|
2020-10-25 09:25:23 +08:00
|
|
|
|
2020-10-26 08:39:21 +08:00
|
|
|
describe('null', () => {
|
2020-10-25 09:25:23 +08:00
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'null01',
|
2020-10-25 09:25:23 +08:00
|
|
|
'event_null.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: undefined,
|
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.version=",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'null02',
|
2020-10-25 09:25:23 +08:00
|
|
|
'event_empty.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
2021-05-08 03:53:30 +08:00
|
|
|
`type=sha`,
|
|
|
|
`type=raw,{{branch}}`,
|
2021-03-29 19:04:53 +08:00
|
|
|
]
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: undefined,
|
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.version=",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2021-03-29 19:04:53 +08:00
|
|
|
])('given %p with %p event', tagsLabelsTest);
|
2020-10-26 08:39:21 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('push', () => {
|
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'push01',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_push.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'dev',
|
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2020-10-26 08:39:21 +08:00
|
|
|
'user/app:dev'
|
2020-10-25 09:25:23 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=dev",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'push02',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_push_defbranch.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=edge`
|
|
|
|
],
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'edge',
|
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2020-10-26 08:39:21 +08:00
|
|
|
'user/app:edge'
|
2020-10-25 09:25:23 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=edge",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'push03',
|
2020-10-25 09:25:23 +08:00
|
|
|
'event_push_defbranch.env',
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'master',
|
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:master'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=master",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'push04',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_workflow_dispatch.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=edge`
|
|
|
|
],
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'edge',
|
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
|
|
|
'user/app:edge'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.version=edge",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-26 08:39:21 +08:00
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'push05',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_push.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'dev',
|
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:dev',
|
|
|
|
'ghcr.io/user/app:dev'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=dev",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-25 22:32:14 +08:00
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'push06',
|
2020-10-25 22:32:14 +08:00
|
|
|
'event_push_defbranch.env',
|
|
|
|
{
|
2020-10-26 08:39:21 +08:00
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=edge`
|
|
|
|
],
|
2020-10-25 22:32:14 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'edge',
|
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 22:32:14 +08:00
|
|
|
[
|
2020-10-26 08:39:21 +08:00
|
|
|
'org/app:edge',
|
|
|
|
'ghcr.io/user/app:edge'
|
2020-10-25 22:32:14 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=edge",
|
2020-10-25 22:32:14 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'push07',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_push.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
2020-10-26 08:39:21 +08:00
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=sha`
|
|
|
|
],
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'dev',
|
2021-03-29 19:04:53 +08:00
|
|
|
partial: ['sha-90dd603'],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2020-10-26 08:39:21 +08:00
|
|
|
'org/app:dev',
|
|
|
|
'org/app:sha-90dd603',
|
|
|
|
'ghcr.io/user/app:dev',
|
|
|
|
'ghcr.io/user/app:sha-90dd603'
|
2020-10-25 09:25:23 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=dev",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'push08',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_push_defbranch.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
2020-10-26 08:39:21 +08:00
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=edge`,
|
|
|
|
`type=sha`
|
|
|
|
],
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'edge',
|
2021-03-29 19:04:53 +08:00
|
|
|
partial: ['sha-90dd603'],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2020-10-26 08:39:21 +08:00
|
|
|
'org/app:edge',
|
|
|
|
'org/app:sha-90dd603',
|
|
|
|
'ghcr.io/user/app:edge',
|
|
|
|
'ghcr.io/user/app:sha-90dd603'
|
2020-10-25 09:25:23 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=edge",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-25 22:13:43 +08:00
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'push09',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_push.env',
|
2020-10-25 22:13:43 +08:00
|
|
|
{
|
2020-10-26 08:39:21 +08:00
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=edge,branch=dev`,
|
|
|
|
`type=sha`
|
|
|
|
],
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'edge',
|
2021-03-29 19:04:53 +08:00
|
|
|
partial: ['sha-90dd603'],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 22:13:43 +08:00
|
|
|
[
|
2020-10-26 08:39:21 +08:00
|
|
|
'org/app:edge',
|
|
|
|
'org/app:sha-90dd603',
|
|
|
|
'ghcr.io/user/app:edge',
|
|
|
|
'ghcr.io/user/app:sha-90dd603'
|
2020-10-25 22:13:43 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=edge",
|
2020-10-25 22:13:43 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'push10',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_push_defbranch.env',
|
2020-10-25 22:13:43 +08:00
|
|
|
{
|
2020-10-26 08:39:21 +08:00
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=edge,branch=dev`,
|
|
|
|
`type=sha`
|
|
|
|
],
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'master',
|
2021-03-29 19:04:53 +08:00
|
|
|
partial: ['sha-90dd603'],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 22:13:43 +08:00
|
|
|
[
|
2020-10-26 08:39:21 +08:00
|
|
|
'org/app:master',
|
|
|
|
'org/app:sha-90dd603',
|
|
|
|
'ghcr.io/user/app:master',
|
|
|
|
'ghcr.io/user/app:sha-90dd603'
|
2020-10-25 22:13:43 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=master",
|
2020-10-25 22:13:43 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
2020-12-08 07:01:39 +08:00
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'push11',
|
2020-12-08 07:01:39 +08:00
|
|
|
'event_push_invalidchars.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=edge`,
|
|
|
|
`type=sha`
|
|
|
|
],
|
2020-12-08 07:01:39 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'my-feature-1245',
|
2021-03-29 19:04:53 +08:00
|
|
|
partial: ['sha-90dd603'],
|
2020-12-08 07:01:39 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:my-feature-1245',
|
|
|
|
'org/app:sha-90dd603',
|
|
|
|
'ghcr.io/user/app:my-feature-1245',
|
|
|
|
'ghcr.io/user/app:sha-90dd603'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=my-feature-1245",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
2020-10-25 22:13:43 +08:00
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2021-03-29 19:04:53 +08:00
|
|
|
[
|
|
|
|
'push12',
|
|
|
|
'event_push_invalidchars.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{version}}`,
|
|
|
|
`type=edge`
|
|
|
|
],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'my-feature-1245',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:my-feature-1245',
|
|
|
|
'ghcr.io/user/app:my-feature-1245'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=my-feature-1245",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'push13',
|
|
|
|
'event_push_defbranch.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,priority=2000,event=branch`,
|
|
|
|
`type=edge`
|
|
|
|
],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'master',
|
|
|
|
partial: ['edge'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:master',
|
|
|
|
'user/app:edge'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=master",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'push14',
|
|
|
|
'event_push_defbranch.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{version}},value=v1.2.3`,
|
|
|
|
`type=edge`
|
|
|
|
],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.2.3',
|
|
|
|
partial: ['edge'],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:1.2.3',
|
|
|
|
'user/app:edge',
|
|
|
|
'user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=1.2.3",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'push15',
|
|
|
|
'event_push_defbranch.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=match,pattern=v(.*),group=1,value=v1.2.3`,
|
|
|
|
`type=edge`
|
|
|
|
],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.2.3',
|
|
|
|
partial: ['edge'],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:1.2.3',
|
|
|
|
'user/app:edge',
|
|
|
|
'user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=1.2.3",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
2021-03-30 19:57:28 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'push16',
|
|
|
|
'event_push_defbranch.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=match,enable=false,pattern=v(.*),group=1,value=v1.2.3`,
|
|
|
|
`type=edge`
|
|
|
|
],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'edge',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:edge'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=edge",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
2021-05-08 03:53:30 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'push17',
|
|
|
|
'event_push_defbranch.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=raw,value=mytag-{{branch}}`,
|
|
|
|
`type=raw,value=mytag-{{tag}}`
|
|
|
|
],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'mytag-master',
|
|
|
|
partial: ['mytag-'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:mytag-master',
|
|
|
|
'user/app:mytag-'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=mytag-master",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
2021-03-29 19:04:53 +08:00
|
|
|
]
|
|
|
|
])('given %p with %p event', tagsLabelsTest);
|
2020-10-26 08:39:21 +08:00
|
|
|
});
|
|
|
|
|
2021-03-29 19:04:53 +08:00
|
|
|
describe('tag', () => {
|
2020-10-26 08:39:21 +08:00
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'tag01',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_tag_release1.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'release1',
|
|
|
|
partial: [],
|
2020-10-29 01:25:31 +08:00
|
|
|
latest: true
|
2020-10-26 08:39:21 +08:00
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2020-10-29 01:25:31 +08:00
|
|
|
'user/app:release1',
|
|
|
|
'user/app:latest'
|
2020-10-25 09:25:23 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.version=release1",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'tag02',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_tag_20200110-RC2.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: '20200110-RC2',
|
|
|
|
partial: [],
|
2020-10-29 01:25:31 +08:00
|
|
|
latest: true
|
2020-10-26 08:39:21 +08:00
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2020-10-29 01:25:31 +08:00
|
|
|
'user/app:20200110-RC2',
|
|
|
|
'user/app:latest'
|
2020-10-25 09:25:23 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=20200110-RC2",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'tag03',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_tag_20200110-RC2.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=match,pattern=\\d{8}`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: '20200110',
|
|
|
|
partial: [],
|
2020-10-27 07:57:32 +08:00
|
|
|
latest: false
|
2020-10-26 08:39:21 +08:00
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2020-10-27 07:57:32 +08:00
|
|
|
'user/app:20200110'
|
2020-10-25 09:25:23 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
2020-10-27 09:32:26 +08:00
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-27 09:32:26 +08:00
|
|
|
"org.opencontainers.image.version=20200110",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'tag04',
|
2020-10-27 09:32:26 +08:00
|
|
|
'event_tag_20200110-RC2.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=match,pattern=(.*)-RC,group=1`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
2020-10-27 09:32:26 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: '20200110',
|
|
|
|
partial: [],
|
2020-10-27 09:32:26 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:20200110'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=20200110",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'tag05',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_tag_v1.1.1.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
2021-04-04 00:15:27 +08:00
|
|
|
`type=match,"pattern=\\d.\\d.\\d"`
|
2021-03-29 19:04:53 +08:00
|
|
|
]
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: '1.1.1',
|
|
|
|
partial: [],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.1.1',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.1.1',
|
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=1.1.1",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'tag06',
|
2020-11-18 06:31:03 +08:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
2021-04-04 00:15:27 +08:00
|
|
|
`type=match,"pattern=^v(\\d.\\d.\\d)$",group=1`
|
2021-03-29 19:04:53 +08:00
|
|
|
]
|
2020-11-18 06:31:03 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.1.1',
|
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2020-10-26 08:39:21 +08:00
|
|
|
'org/app:1.1.1',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.1.1',
|
|
|
|
'ghcr.io/user/app:latest'
|
2020-10-25 09:25:23 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=1.1.1",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'tag07',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
2021-04-04 00:15:27 +08:00
|
|
|
`type=match,"pattern=\\d.\\d.\\d-(alpha|beta).\\d+"`
|
2021-03-29 19:04:53 +08:00
|
|
|
]
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: '2.0.8-beta.67',
|
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2020-10-26 08:39:21 +08:00
|
|
|
'org/app:2.0.8-beta.67',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:2.0.8-beta.67',
|
|
|
|
'ghcr.io/user/app:latest'
|
2020-10-25 09:25:23 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=2.0.8-beta.67",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'tag08',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
2021-04-04 00:15:27 +08:00
|
|
|
`type=match,"pattern=\\d.\\d"`
|
2021-03-29 19:04:53 +08:00
|
|
|
]
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: '2.0',
|
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2020-10-26 08:39:21 +08:00
|
|
|
'org/app:2.0',
|
2020-10-25 09:25:23 +08:00
|
|
|
'org/app:latest',
|
2020-10-26 08:39:21 +08:00
|
|
|
'ghcr.io/user/app:2.0',
|
2020-10-25 09:25:23 +08:00
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=2.0",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-11-18 06:31:03 +08:00
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'tag09',
|
2020-11-18 06:31:03 +08:00
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
2021-04-06 03:19:05 +08:00
|
|
|
`type=match,"pattern=v(.*)-beta.(.*)",group=1`,
|
|
|
|
`type=match,"pattern=v(.*)-beta.(.*)",group=2`,
|
2021-03-29 19:04:53 +08:00
|
|
|
]
|
2020-11-18 06:31:03 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2021-04-06 03:19:05 +08:00
|
|
|
main: '2.0.8',
|
|
|
|
partial: ['67'],
|
|
|
|
latest: true
|
2020-11-18 06:31:03 +08:00
|
|
|
} as Version,
|
|
|
|
[
|
2021-04-06 03:19:05 +08:00
|
|
|
'org/app:2.0.8',
|
|
|
|
'org/app:67',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:2.0.8',
|
|
|
|
'ghcr.io/user/app:67',
|
|
|
|
'ghcr.io/user/app:latest'
|
2020-11-18 06:31:03 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2021-04-06 03:19:05 +08:00
|
|
|
"org.opencontainers.image.version=2.0.8",
|
2020-11-18 06:31:03 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-26 08:39:21 +08:00
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'tag10',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_tag_sometag.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
2021-04-04 00:15:27 +08:00
|
|
|
`type=match,"pattern=\\d.\\d"`
|
2021-03-29 19:04:53 +08:00
|
|
|
]
|
2020-10-26 08:39:21 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2021-04-06 03:19:05 +08:00
|
|
|
main: undefined,
|
2020-11-18 06:31:03 +08:00
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2021-04-06 03:19:05 +08:00
|
|
|
[],
|
2020-10-26 08:39:21 +08:00
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2021-04-06 03:19:05 +08:00
|
|
|
"org.opencontainers.image.version=",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-11-18 06:31:03 +08:00
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'tag11',
|
2020-11-18 06:31:03 +08:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{version}}`,
|
|
|
|
`type=semver,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=semver,pattern={{major}}`
|
|
|
|
]
|
2020-11-18 06:31:03 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.1.1',
|
|
|
|
partial: ['1.1', '1'],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.1.1',
|
|
|
|
'org/app:1.1',
|
|
|
|
'org/app:1',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.1.1',
|
|
|
|
'ghcr.io/user/app:1.1',
|
|
|
|
'ghcr.io/user/app:1',
|
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=1.1.1",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
2020-11-18 08:10:05 +08:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'tag12',
|
2020-11-18 08:10:05 +08:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{version}}`,
|
|
|
|
`type=semver,pattern={{major}}.{{minor}}.{{patch}}`
|
|
|
|
]
|
2020-11-18 08:10:05 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.1.1',
|
|
|
|
partial: [],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.1.1',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.1.1',
|
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=1.1.1",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
2020-11-18 06:31:03 +08:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'tag13',
|
2020-11-18 06:31:03 +08:00
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=semver,pattern={{major}}`
|
|
|
|
]
|
2020-11-18 06:31:03 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '2.0.8-beta.67',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:2.0.8-beta.67',
|
|
|
|
'ghcr.io/user/app:2.0.8-beta.67'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=2.0.8-beta.67",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
2020-12-01 12:50:39 +08:00
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'tag14',
|
2020-12-01 12:50:39 +08:00
|
|
|
'event_tag_sometag.env',
|
|
|
|
{
|
|
|
|
images: ['ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`,
|
|
|
|
`type=semver,pattern={{version}}`,
|
|
|
|
`type=semver,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=semver,pattern={{major}}`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
2020-12-01 12:50:39 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'sometag',
|
|
|
|
partial: [],
|
2020-12-01 13:29:34 +08:00
|
|
|
latest: false
|
2020-12-01 12:50:39 +08:00
|
|
|
} as Version,
|
|
|
|
[
|
2020-12-01 13:29:34 +08:00
|
|
|
'ghcr.io/user/app:sometag'
|
2020-12-01 12:50:39 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=sometag",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
2020-11-18 06:31:03 +08:00
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2021-03-29 19:04:53 +08:00
|
|
|
[
|
|
|
|
'tag15',
|
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=raw,priority=2000,foo`,
|
|
|
|
`type=semver,pattern={{version}}`,
|
2021-04-04 00:15:27 +08:00
|
|
|
`type=match,"pattern=\\d.\\d"`
|
2021-03-29 19:04:53 +08:00
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'foo',
|
|
|
|
partial: ['2.0.8-beta.67', '2.0'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:foo',
|
|
|
|
'org/app:2.0.8-beta.67',
|
|
|
|
'org/app:2.0',
|
|
|
|
'ghcr.io/user/app:foo',
|
|
|
|
'ghcr.io/user/app:2.0.8-beta.67',
|
|
|
|
'ghcr.io/user/app:2.0'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=foo",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag16',
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=raw,priority=2000,foo`,
|
|
|
|
`type=ref,event=tag`,
|
|
|
|
`type=edge`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'foo',
|
|
|
|
partial: ['v1.1.1'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:foo',
|
|
|
|
'org/app:v1.1.1',
|
|
|
|
'ghcr.io/user/app:foo',
|
|
|
|
'ghcr.io/user/app:v1.1.1',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=foo",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
2021-04-06 03:19:05 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag17',
|
|
|
|
'event_tag_p1-v1.0.0.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=match,"pattern=/^v(\\d.\\d.\\d)$/ig",group=1`,
|
|
|
|
`type=match,pattern=\\d.\\d.\\d`,
|
|
|
|
`type=match,pattern=\\d.\\d`,
|
|
|
|
`type=ref,event=pr`,
|
|
|
|
`type=sha`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.0.0',
|
|
|
|
partial: ['1.0', 'sha-90dd603'],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.0.0',
|
|
|
|
'org/app:1.0',
|
|
|
|
'org/app:sha-90dd603',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.0.0',
|
|
|
|
'ghcr.io/user/app:1.0',
|
|
|
|
'ghcr.io/user/app:sha-90dd603',
|
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=1.0.0",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag18',
|
|
|
|
'event_tag_p1-v1.0.0.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=match,pattern=p1-v(\\d.\\d.\\d),group=1`,
|
|
|
|
`type=match,pattern=p1-v(\\d.\\d),group=1`,
|
|
|
|
`type=match,pattern=p1-v(\\d.\\d),group=3`,
|
|
|
|
`type=ref,event=pr`,
|
|
|
|
`type=sha`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.0.0',
|
|
|
|
partial: ['1.0', 'sha-90dd603'],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.0.0',
|
|
|
|
'org/app:1.0',
|
|
|
|
'org/app:sha-90dd603',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.0.0',
|
|
|
|
'ghcr.io/user/app:1.0',
|
|
|
|
'ghcr.io/user/app:sha-90dd603',
|
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=1.0.0",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
2021-04-08 02:54:35 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag19',
|
|
|
|
'event_tag_p1-v1.0.0.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=match,pattern=p1-v(\\d.\\d.\\d),group=1`,
|
|
|
|
`type=match,pattern=p1-v(\\d.\\d),group=1,suffix=`,
|
|
|
|
`type=ref,event=pr`,
|
|
|
|
`type=sha`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`suffix=-dev`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.0.0-dev',
|
|
|
|
partial: ['1.0', 'sha-90dd603-dev'],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.0.0-dev',
|
|
|
|
'org/app:1.0',
|
|
|
|
'org/app:sha-90dd603-dev',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.0.0-dev',
|
|
|
|
'ghcr.io/user/app:1.0',
|
|
|
|
'ghcr.io/user/app:sha-90dd603-dev',
|
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=1.0.0-dev",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
2021-05-08 03:53:30 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag20',
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=raw,{{tag}}-{{sha}}-foo`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'v1.1.1-90dd603-foo',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:v1.1.1-90dd603-foo',
|
|
|
|
'ghcr.io/user/app:v1.1.1-90dd603-foo'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=v1.1.1-90dd603-foo",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
2021-03-29 19:04:53 +08:00
|
|
|
]
|
|
|
|
])('given %p with %p event', tagsLabelsTest);
|
2020-10-26 08:39:21 +08:00
|
|
|
});
|
|
|
|
|
2020-10-27 00:51:00 +08:00
|
|
|
describe('latest', () => {
|
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'latest01',
|
2020-10-27 00:51:00 +08:00
|
|
|
'event_tag_release1.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=match,"pattern=^release\\d{1,2}"`
|
|
|
|
],
|
2020-10-27 00:51:00 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'release1',
|
|
|
|
partial: [],
|
2020-10-27 00:51:00 +08:00
|
|
|
latest: true,
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:release1',
|
|
|
|
'user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-27 00:51:00 +08:00
|
|
|
"org.opencontainers.image.version=release1",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'latest02',
|
2020-10-27 00:51:00 +08:00
|
|
|
'event_tag_20200110-RC2.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=match,"pattern=^\\d+-RC\\d{1,2}"`
|
|
|
|
]
|
2020-10-27 00:51:00 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: '20200110-RC2',
|
|
|
|
partial: [],
|
2020-10-27 00:51:00 +08:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:20200110-RC2',
|
|
|
|
'user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-27 00:51:00 +08:00
|
|
|
"org.opencontainers.image.version=20200110-RC2",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'latest03',
|
2020-10-27 00:51:00 +08:00
|
|
|
'event_tag_20200110-RC2.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=match,pattern=\\d{8}`
|
|
|
|
]
|
2020-10-27 00:51:00 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: '20200110',
|
|
|
|
partial: [],
|
2020-10-27 00:51:00 +08:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:20200110',
|
|
|
|
'user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-27 00:51:00 +08:00
|
|
|
"org.opencontainers.image.version=20200110",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'latest04',
|
2020-10-27 00:51:00 +08:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
2021-04-04 00:15:27 +08:00
|
|
|
`type=match,"pattern=\\d.\\d.\\d"`
|
2021-03-29 19:04:53 +08:00
|
|
|
]
|
2020-10-27 00:51:00 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: '1.1.1',
|
|
|
|
partial: [],
|
2020-10-27 00:51:00 +08:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:1.1.1',
|
|
|
|
'user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-27 00:51:00 +08:00
|
|
|
"org.opencontainers.image.version=1.1.1",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'latest05',
|
2020-10-27 00:51:00 +08:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'v1.1.1',
|
|
|
|
partial: [],
|
2020-10-29 01:25:31 +08:00
|
|
|
latest: true
|
2020-10-27 00:51:00 +08:00
|
|
|
} as Version,
|
|
|
|
[
|
2020-10-27 07:57:32 +08:00
|
|
|
'org/app:v1.1.1',
|
2020-10-29 01:25:31 +08:00
|
|
|
'org/app:latest',
|
2020-10-27 07:57:32 +08:00
|
|
|
'ghcr.io/user/app:v1.1.1',
|
2020-10-29 01:25:31 +08:00
|
|
|
'ghcr.io/user/app:latest',
|
2020-10-27 00:51:00 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-27 07:57:32 +08:00
|
|
|
"org.opencontainers.image.version=v1.1.1",
|
2020-10-27 00:51:00 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'latest06',
|
2020-10-27 00:51:00 +08:00
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
2021-04-04 00:15:27 +08:00
|
|
|
`type=match,"pattern=\\d.\\d.\\d"`
|
2021-03-29 19:04:53 +08:00
|
|
|
]
|
2020-10-27 00:51:00 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: '2.0.8',
|
|
|
|
partial: [],
|
2020-10-27 00:51:00 +08:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
2020-10-27 07:57:32 +08:00
|
|
|
'org/app:2.0.8',
|
2020-10-27 00:51:00 +08:00
|
|
|
'org/app:latest',
|
2020-10-27 07:57:32 +08:00
|
|
|
'ghcr.io/user/app:2.0.8',
|
2020-10-27 00:51:00 +08:00
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-27 07:57:32 +08:00
|
|
|
"org.opencontainers.image.version=2.0.8",
|
2020-10-27 00:51:00 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-11-01 02:52:55 +08:00
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'latest07',
|
2020-11-01 02:52:55 +08:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
2020-11-01 02:52:55 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'v1.1.1',
|
|
|
|
partial: [],
|
2020-11-01 02:52:55 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:v1.1.1',
|
|
|
|
'ghcr.io/user/app:v1.1.1',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-11-01 02:52:55 +08:00
|
|
|
"org.opencontainers.image.version=v1.1.1",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
2020-11-20 23:30:57 +08:00
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'latest08',
|
2020-11-20 23:30:57 +08:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/MyUSER/MyApp'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
2020-11-20 23:30:57 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'v1.1.1',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:v1.1.1',
|
|
|
|
'ghcr.io/myuser/myapp:v1.1.1',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=v1.1.1",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
2020-11-01 02:52:55 +08:00
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-12-24 05:09:38 +08:00
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'latest09',
|
2020-12-24 05:09:38 +08:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/MyUSER/MyApp'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
],
|
|
|
|
labels: [
|
2020-12-24 05:09:38 +08:00
|
|
|
"maintainer=CrazyMax",
|
|
|
|
"org.opencontainers.image.title=MyCustomTitle",
|
|
|
|
"org.opencontainers.image.description=Another description",
|
|
|
|
"org.opencontainers.image.vendor=MyCompany",
|
2021-03-29 19:04:53 +08:00
|
|
|
]
|
2020-12-24 05:09:38 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'v1.1.1',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:v1.1.1',
|
|
|
|
'ghcr.io/myuser/myapp:v1.1.1',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=v1.1.1",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
|
|
|
"maintainer=CrazyMax",
|
|
|
|
"org.opencontainers.image.title=MyCustomTitle",
|
|
|
|
"org.opencontainers.image.description=Another description",
|
|
|
|
"org.opencontainers.image.vendor=MyCompany"
|
|
|
|
]
|
|
|
|
],
|
2021-03-29 19:04:53 +08:00
|
|
|
])('given %p with %p event', tagsLabelsTest);
|
2020-10-27 00:51:00 +08:00
|
|
|
});
|
|
|
|
|
2021-03-29 19:04:53 +08:00
|
|
|
describe('pr', () => {
|
2020-10-26 08:39:21 +08:00
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'pr01',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'pr-2',
|
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:pr-2'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=pr-2",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=1e9249f05bfc090e0688b8fb9c1b347586add504",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'pr02',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'pr-2',
|
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:pr-2',
|
|
|
|
'ghcr.io/user/app:pr-2'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=pr-2",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=1e9249f05bfc090e0688b8fb9c1b347586add504",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'pr03',
|
2020-10-25 09:25:23 +08:00
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=pr`,
|
|
|
|
`type=sha`
|
|
|
|
]
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'pr-2',
|
2021-03-29 19:04:53 +08:00
|
|
|
partial: ['sha-1e9249f'],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
|
|
|
'org/app:pr-2',
|
|
|
|
'org/app:sha-1e9249f',
|
|
|
|
'ghcr.io/user/app:pr-2',
|
|
|
|
'ghcr.io/user/app:sha-1e9249f'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.version=pr-2",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=1e9249f05bfc090e0688b8fb9c1b347586add504",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2021-03-29 19:04:53 +08:00
|
|
|
[
|
|
|
|
'pr04',
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=sha,priority=2000`,
|
|
|
|
`type=ref,event=pr`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'sha-1e9249f',
|
|
|
|
partial: ['pr-2'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:sha-1e9249f',
|
|
|
|
'org/app:pr-2',
|
|
|
|
'ghcr.io/user/app:sha-1e9249f',
|
|
|
|
'ghcr.io/user/app:pr-2'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=sha-1e9249f",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=1e9249f05bfc090e0688b8fb9c1b347586add504",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2021-04-08 02:31:35 +08:00
|
|
|
[
|
|
|
|
'pr05',
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=pr`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`prefix=glo-`,
|
|
|
|
`suffix=-bal`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'pr-2-bal',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:pr-2-bal',
|
|
|
|
'ghcr.io/user/app:pr-2-bal'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=pr-2-bal",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=1e9249f05bfc090e0688b8fb9c1b347586add504",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr06',
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=pr,prefix=`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`prefix=glo-`,
|
|
|
|
`suffix=-bal`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2021-04-08 02:54:35 +08:00
|
|
|
main: '2-bal',
|
2021-04-08 02:31:35 +08:00
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
2021-04-08 02:54:35 +08:00
|
|
|
'org/app:2-bal',
|
|
|
|
'ghcr.io/user/app:2-bal'
|
2021-04-08 02:31:35 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2021-04-08 02:54:35 +08:00
|
|
|
"org.opencontainers.image.version=2-bal",
|
2021-04-08 02:31:35 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=1e9249f05bfc090e0688b8fb9c1b347586add504",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
]
|
2021-03-29 19:04:53 +08:00
|
|
|
])('given %p with %p event', tagsLabelsTest);
|
2020-10-26 08:39:21 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('schedule', () => {
|
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'schedule01',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_schedule.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
2020-10-26 08:39:21 +08:00
|
|
|
images: ['user/app'],
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'nightly',
|
2021-03-29 19:04:53 +08:00
|
|
|
partial: ['master'],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'user/app:nightly',
|
|
|
|
'user/app:master'
|
2020-10-25 09:25:23 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=nightly",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'schedule02',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_schedule.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
2020-10-26 08:39:21 +08:00
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=schedule,pattern={{date 'YYYYMMDD'}}`
|
|
|
|
]
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: '20200110',
|
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2020-10-26 08:39:21 +08:00
|
|
|
'user/app:20200110'
|
2020-10-25 09:25:23 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=20200110",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'schedule03',
|
2020-10-25 09:25:23 +08:00
|
|
|
'event_schedule.env',
|
|
|
|
{
|
2020-10-26 08:39:21 +08:00
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=schedule,pattern={{date 'YYYYMMDD-HHmmss'}}`
|
|
|
|
]
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: '20200110-003000',
|
|
|
|
partial: [],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2020-10-26 08:39:21 +08:00
|
|
|
'user/app:20200110-003000'
|
2020-10-25 09:25:23 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=20200110-003000",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'schedule04',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_schedule.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'nightly',
|
2021-03-29 19:04:53 +08:00
|
|
|
partial: ['master'],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2020-10-26 08:39:21 +08:00
|
|
|
'org/app:nightly',
|
2021-03-29 19:04:53 +08:00
|
|
|
'org/app:master',
|
|
|
|
'ghcr.io/user/app:nightly',
|
|
|
|
'ghcr.io/user/app:master'
|
2020-10-25 09:25:23 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=nightly",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'schedule05',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_schedule.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=schedule`,
|
|
|
|
`type=sha`
|
|
|
|
]
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'nightly',
|
2021-03-29 19:04:53 +08:00
|
|
|
partial: ['sha-90dd603'],
|
2020-10-26 08:39:21 +08:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2020-10-26 08:39:21 +08:00
|
|
|
'org/app:nightly',
|
2020-10-25 09:25:23 +08:00
|
|
|
'org/app:sha-90dd603',
|
2020-10-26 08:39:21 +08:00
|
|
|
'ghcr.io/user/app:nightly',
|
2020-10-25 09:25:23 +08:00
|
|
|
'ghcr.io/user/app:sha-90dd603'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 08:39:21 +08:00
|
|
|
"org.opencontainers.image.version=nightly",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2021-03-29 19:04:53 +08:00
|
|
|
[
|
|
|
|
'schedule06',
|
|
|
|
'event_schedule.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=schedule`,
|
|
|
|
`type=sha,priority=2000`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'sha-90dd603',
|
|
|
|
partial: ['nightly'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:sha-90dd603',
|
|
|
|
'org/app:nightly',
|
|
|
|
'ghcr.io/user/app:sha-90dd603',
|
|
|
|
'ghcr.io/user/app:nightly'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=sha-90dd603",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2021-04-08 02:31:35 +08:00
|
|
|
[
|
|
|
|
'schedule07',
|
|
|
|
'event_schedule.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=schedule`,
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`prefix=glo-`,
|
|
|
|
`suffix=-bal`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'glo-nightly-bal',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:glo-nightly-bal',
|
|
|
|
'ghcr.io/user/app:glo-nightly-bal'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=glo-nightly-bal",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2021-03-29 19:04:53 +08:00
|
|
|
])('given %p with %p event', tagsLabelsTest);
|
2020-10-26 08:39:21 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('release', () => {
|
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'release01',
|
2020-10-26 08:39:21 +08:00
|
|
|
'event_release.env',
|
2020-10-25 09:25:23 +08:00
|
|
|
{
|
2020-10-26 08:39:21 +08:00
|
|
|
images: ['user/app'],
|
2020-10-25 22:13:43 +08:00
|
|
|
} as Inputs,
|
2020-10-26 08:39:21 +08:00
|
|
|
{
|
2020-11-18 06:31:03 +08:00
|
|
|
main: 'v1.1.1',
|
|
|
|
partial: [],
|
2020-10-29 01:25:31 +08:00
|
|
|
latest: true
|
2020-10-26 08:39:21 +08:00
|
|
|
} as Version,
|
2020-10-25 09:25:23 +08:00
|
|
|
[
|
2020-10-27 07:57:32 +08:00
|
|
|
'user/app:v1.1.1',
|
2020-10-29 01:25:31 +08:00
|
|
|
'user/app:latest',
|
2020-10-25 09:25:23 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-11-01 03:21:22 +08:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-27 07:57:32 +08:00
|
|
|
"org.opencontainers.image.version=v1.1.1",
|
2020-10-25 09:25:23 +08:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2021-03-29 19:04:53 +08:00
|
|
|
])('given %s with %p event', tagsLabelsTest);
|
2020-10-25 09:25:23 +08:00
|
|
|
});
|
2020-12-05 01:12:39 +08:00
|
|
|
|
2021-03-29 19:04:53 +08:00
|
|
|
describe('raw', () => {
|
2020-12-05 01:12:39 +08:00
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'raw01',
|
2020-12-05 01:12:39 +08:00
|
|
|
'event_push.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
]
|
2020-12-05 01:12:39 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'dev',
|
|
|
|
partial: ['my', 'custom', 'tags'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:dev',
|
|
|
|
'user/app:my',
|
|
|
|
'user/app:custom',
|
|
|
|
'user/app:tags'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=dev",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'raw02',
|
2020-12-05 01:12:39 +08:00
|
|
|
'event_push.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=raw,my`
|
|
|
|
]
|
2020-12-05 01:12:39 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'dev',
|
|
|
|
partial: ['my'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:dev',
|
|
|
|
'user/app:my'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=dev",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'raw03',
|
2020-12-05 01:12:39 +08:00
|
|
|
'event_tag_release1.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
]
|
2020-12-05 01:12:39 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'release1',
|
|
|
|
partial: ['my', 'custom', 'tags'],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:release1',
|
|
|
|
'user/app:my',
|
|
|
|
'user/app:custom',
|
|
|
|
'user/app:tags',
|
|
|
|
'user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=release1",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'raw04',
|
2020-12-05 01:12:39 +08:00
|
|
|
'event_tag_20200110-RC2.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=match,pattern=\\d{8}`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
2020-12-05 01:12:39 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '20200110',
|
|
|
|
partial: ['my', 'custom', 'tags'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:20200110',
|
|
|
|
'user/app:my',
|
|
|
|
'user/app:custom',
|
|
|
|
'user/app:tags'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=20200110",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'raw05',
|
2020-12-05 01:12:39 +08:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{version}}`,
|
|
|
|
`type=semver,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=semver,pattern={{major}}`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
]
|
2020-12-05 01:12:39 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.1.1',
|
|
|
|
partial: ['1.1', '1', 'my', 'custom', 'tags'],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.1.1',
|
|
|
|
'org/app:1.1',
|
|
|
|
'org/app:1',
|
|
|
|
'org/app:my',
|
|
|
|
'org/app:custom',
|
|
|
|
'org/app:tags',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.1.1',
|
|
|
|
'ghcr.io/user/app:1.1',
|
|
|
|
'ghcr.io/user/app:1',
|
|
|
|
'ghcr.io/user/app:my',
|
|
|
|
'ghcr.io/user/app:custom',
|
|
|
|
'ghcr.io/user/app:tags',
|
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=1.1.1",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'raw06',
|
2020-12-05 01:12:39 +08:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
]
|
2020-12-05 01:12:39 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'my',
|
|
|
|
partial: ['custom', 'tags'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:my',
|
|
|
|
'org/app:custom',
|
|
|
|
'org/app:tags',
|
|
|
|
'ghcr.io/user/app:my',
|
|
|
|
'ghcr.io/user/app:custom',
|
|
|
|
'ghcr.io/user/app:tags'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=my",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2021-03-29 19:04:53 +08:00
|
|
|
[
|
|
|
|
'raw07',
|
|
|
|
'event_push.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,priority=90,event=branch`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=true`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'my',
|
|
|
|
partial: ['custom', 'tags', 'dev'],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:my',
|
|
|
|
'user/app:custom',
|
|
|
|
'user/app:tags',
|
|
|
|
'user/app:dev',
|
|
|
|
'user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=my",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'raw08',
|
|
|
|
'event_push.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=match,pattern=\\d{8}`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'my',
|
|
|
|
partial: ['custom', 'tags'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:my',
|
|
|
|
'user/app:custom',
|
|
|
|
'user/app:tags'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=my",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'raw09',
|
|
|
|
'event_push.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=match,pattern=\\d{8}`,
|
|
|
|
`type=raw,my,prefix=foo-,suffix=-bar`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`,
|
|
|
|
`prefix=glo-`,
|
|
|
|
`suffix=-bal`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'foo-my-bar',
|
|
|
|
partial: ['glo-custom-bal', 'glo-tags-bal'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:foo-my-bar',
|
|
|
|
'user/app:glo-custom-bal',
|
|
|
|
'user/app:glo-tags-bal'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=foo-my-bar",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
2021-03-30 19:11:51 +08:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'raw10',
|
|
|
|
'event_push.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=raw,foo`,
|
|
|
|
`type=raw,bar,enable=false`,
|
|
|
|
`type=raw,baz,enable=true`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'foo',
|
|
|
|
partial: ['baz'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:foo',
|
|
|
|
'user/app:baz',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version=foo",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2021-03-29 19:04:53 +08:00
|
|
|
])('given %p wth %p event', tagsLabelsTest);
|
2020-12-05 01:12:39 +08:00
|
|
|
});
|
2020-12-24 11:13:41 +08:00
|
|
|
|
2021-03-29 19:04:53 +08:00
|
|
|
describe('bake', () => {
|
2020-12-24 11:13:41 +08:00
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'bake01',
|
2020-12-24 11:13:41 +08:00
|
|
|
'event_push.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
labels: [
|
|
|
|
"invalid"
|
|
|
|
]
|
2020-12-24 11:13:41 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"target": {
|
|
|
|
"ghaction-docker-meta": {
|
|
|
|
"tags": [
|
|
|
|
"user/app:dev",
|
|
|
|
"user/app:my",
|
|
|
|
"user/app:custom",
|
|
|
|
"user/app:tags"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.title": "Hello-World",
|
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version": "dev",
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision": "90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses": "MIT"
|
2020-12-24 23:45:28 +08:00
|
|
|
},
|
|
|
|
"args": {
|
|
|
|
"DOCKER_META_IMAGES": "user/app",
|
|
|
|
"DOCKER_META_VERSION": "dev",
|
2020-12-24 11:13:41 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'bake02',
|
2020-12-24 11:13:41 +08:00
|
|
|
'event_push.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=raw,my`
|
|
|
|
]
|
2020-12-24 11:13:41 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"target": {
|
|
|
|
"ghaction-docker-meta": {
|
|
|
|
"tags": [
|
|
|
|
"user/app:dev",
|
|
|
|
"user/app:my",
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.title": "Hello-World",
|
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version": "dev",
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision": "90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses": "MIT"
|
2020-12-24 23:45:28 +08:00
|
|
|
},
|
|
|
|
"args": {
|
|
|
|
"DOCKER_META_IMAGES": "user/app",
|
|
|
|
"DOCKER_META_VERSION": "dev",
|
2020-12-24 11:13:41 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'bake03',
|
2020-12-24 11:13:41 +08:00
|
|
|
'event_tag_release1.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
2021-04-30 06:51:48 +08:00
|
|
|
],
|
|
|
|
bakeTarget: "meta"
|
2020-12-24 11:13:41 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"target": {
|
2021-04-30 06:51:48 +08:00
|
|
|
"meta": {
|
2020-12-24 11:13:41 +08:00
|
|
|
"tags": [
|
|
|
|
"user/app:release1",
|
|
|
|
"user/app:my",
|
|
|
|
"user/app:custom",
|
|
|
|
"user/app:tags",
|
|
|
|
"user/app:latest"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.title": "Hello-World",
|
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version": "release1",
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision": "90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses": "MIT"
|
2020-12-24 23:45:28 +08:00
|
|
|
},
|
|
|
|
"args": {
|
|
|
|
"DOCKER_META_IMAGES": "user/app",
|
|
|
|
"DOCKER_META_VERSION": "release1",
|
2020-12-24 11:13:41 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'bake04',
|
2020-12-24 11:13:41 +08:00
|
|
|
'event_tag_20200110-RC2.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=match,pattern=\\d{8}`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
2020-12-24 11:13:41 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"target": {
|
|
|
|
"ghaction-docker-meta": {
|
|
|
|
"tags": [
|
|
|
|
"user/app:20200110",
|
|
|
|
"user/app:my",
|
|
|
|
"user/app:custom",
|
|
|
|
"user/app:tags"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.title": "Hello-World",
|
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version": "20200110",
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision": "90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses": "MIT"
|
2020-12-24 23:45:28 +08:00
|
|
|
},
|
|
|
|
"args": {
|
|
|
|
"DOCKER_META_IMAGES": "user/app",
|
|
|
|
"DOCKER_META_VERSION": "20200110",
|
2020-12-24 11:13:41 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'bake05',
|
2020-12-24 11:13:41 +08:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{version}}`,
|
|
|
|
`type=semver,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=semver,pattern={{major}}`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
]
|
2020-12-24 11:13:41 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"target": {
|
|
|
|
"ghaction-docker-meta": {
|
|
|
|
"tags": [
|
|
|
|
"org/app:1.1.1",
|
|
|
|
"org/app:1.1",
|
|
|
|
"org/app:1",
|
|
|
|
"org/app:my",
|
|
|
|
"org/app:custom",
|
|
|
|
"org/app:tags",
|
|
|
|
"org/app:latest",
|
|
|
|
"ghcr.io/user/app:1.1.1",
|
|
|
|
"ghcr.io/user/app:1.1",
|
|
|
|
"ghcr.io/user/app:1",
|
|
|
|
"ghcr.io/user/app:my",
|
|
|
|
"ghcr.io/user/app:custom",
|
|
|
|
"ghcr.io/user/app:tags",
|
|
|
|
"ghcr.io/user/app:latest"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.title": "Hello-World",
|
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version": "1.1.1",
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision": "90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses": "MIT"
|
2020-12-24 23:45:28 +08:00
|
|
|
},
|
|
|
|
"args": {
|
|
|
|
"DOCKER_META_IMAGES": "org/app,ghcr.io/user/app",
|
|
|
|
"DOCKER_META_VERSION": "1.1.1",
|
2020-12-24 11:13:41 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'bake06',
|
2020-12-24 11:13:41 +08:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
tags: [
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
]
|
2020-12-24 11:13:41 +08:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"target": {
|
|
|
|
"ghaction-docker-meta": {
|
|
|
|
"tags": [
|
|
|
|
"org/app:my",
|
|
|
|
"org/app:custom",
|
|
|
|
"org/app:tags",
|
|
|
|
"ghcr.io/user/app:my",
|
|
|
|
"ghcr.io/user/app:custom",
|
|
|
|
"ghcr.io/user/app:tags"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.title": "Hello-World",
|
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.version": "my",
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision": "90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses": "MIT"
|
2020-12-24 23:45:28 +08:00
|
|
|
},
|
|
|
|
"args": {
|
|
|
|
"DOCKER_META_IMAGES": "org/app,ghcr.io/user/app",
|
|
|
|
"DOCKER_META_VERSION": "my",
|
2020-12-24 11:13:41 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 19:04:53 +08:00
|
|
|
'bake07',
|
2020-12-24 11:13:41 +08:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app'],
|
2021-03-29 19:04:53 +08:00
|
|
|
labels: [
|
2020-12-24 11:13:41 +08:00
|
|
|
"maintainer=CrazyMax",
|
|
|
|
"org.opencontainers.image.title=MyCustom=Title",
|
|
|
|
"org.opencontainers.image.description=Another description",
|
|
|
|
"org.opencontainers.image.vendor=MyCompany",
|
|
|
|
],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"target": {
|
|
|
|
"ghaction-docker-meta": {
|
|
|
|
"tags": [
|
|
|
|
"org/app:v1.1.1",
|
|
|
|
"org/app:latest"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"maintainer": "CrazyMax",
|
|
|
|
"org.opencontainers.image.title": "MyCustom=Title",
|
|
|
|
"org.opencontainers.image.description": "Another description",
|
|
|
|
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.vendor": "MyCompany",
|
|
|
|
"org.opencontainers.image.version": "v1.1.1",
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision": "90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses": "MIT"
|
2020-12-24 23:45:28 +08:00
|
|
|
},
|
|
|
|
"args": {
|
|
|
|
"DOCKER_META_IMAGES": "org/app",
|
|
|
|
"DOCKER_META_VERSION": "v1.1.1",
|
2020-12-24 11:13:41 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2021-03-29 19:04:53 +08:00
|
|
|
])('given %p with %p event', async (name: string, envFile: string, inputs: Inputs, exBakeDefinition: {}) => {
|
2020-12-24 11:13:41 +08:00
|
|
|
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
|
|
|
|
const context = github.context();
|
|
|
|
console.log(process.env, context);
|
|
|
|
|
|
|
|
const repo = await github.repo(process.env.GITHUB_TOKEN || '');
|
|
|
|
const meta = new Meta({...getInputs(), ...inputs}, context, repo);
|
|
|
|
|
2021-03-29 19:04:53 +08:00
|
|
|
const bakeFile = meta.getBakeFile();
|
2020-12-24 11:13:41 +08:00
|
|
|
console.log('bakeFile', bakeFile, fs.readFileSync(bakeFile, 'utf8'));
|
|
|
|
expect(JSON.parse(fs.readFileSync(bakeFile, 'utf8'))).toEqual(exBakeDefinition);
|
|
|
|
});
|
|
|
|
});
|