2020-10-25 02:25:23 +01:00
|
|
|
import * as fs from 'fs';
|
|
|
|
import * as path from 'path';
|
|
|
|
import * as dotenv from 'dotenv';
|
2020-10-25 15:13:43 +01:00
|
|
|
import * as moment from 'moment';
|
|
|
|
import {getInputs, Inputs} from '../src/context';
|
2020-10-25 02:25:23 +01:00
|
|
|
import * as github from '../src/github';
|
2020-10-26 01:39:21 +01:00
|
|
|
import {Meta, Version} from '../src/meta';
|
2020-10-25 02:25:23 +01: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 15:13:43 +01:00
|
|
|
jest.mock('moment', () => {
|
|
|
|
return () => jest.requireActual('moment')('2020-01-10T00:30:00.000Z');
|
|
|
|
});
|
|
|
|
|
2020-10-26 01:39:21 +01:00
|
|
|
beforeEach(() => {
|
|
|
|
Object.keys(process.env).forEach(function (key) {
|
|
|
|
if (key !== 'GITHUB_TOKEN' && key.startsWith('GITHUB_')) {
|
|
|
|
delete process.env[key];
|
|
|
|
}
|
2020-10-25 02:25:23 +01:00
|
|
|
});
|
2020-10-26 01:39:21 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
const tagsLabelsTest = async (envFile: string, inputs: Inputs, exVersion: Version, exTags: Array<string>, exLabels: Array<string>) => {
|
|
|
|
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 05:38:08 +01:00
|
|
|
const version = meta.version;
|
2020-10-26 01:39:21 +01:00
|
|
|
console.log('version', version);
|
|
|
|
expect(version).toEqual(exVersion);
|
|
|
|
|
|
|
|
const tags = meta.tags();
|
|
|
|
console.log('tags', tags);
|
|
|
|
expect(tags).toEqual(exTags);
|
|
|
|
|
|
|
|
const labels = meta.labels();
|
|
|
|
console.log('labels', labels);
|
|
|
|
expect(labels).toEqual(exLabels);
|
|
|
|
};
|
2020-10-25 02:25:23 +01:00
|
|
|
|
2020-10-26 01:39:21 +01:00
|
|
|
describe('null', () => {
|
2020-10-25 02:25:23 +01:00
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
|
|
|
[
|
|
|
|
'event_null.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: undefined,
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.version=",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_empty.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: undefined,
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.version=",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-26 01:39:21 +01:00
|
|
|
])('given %p event ', tagsLabelsTest);
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('push', () => {
|
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_push.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'dev',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'user/app:dev'
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=dev",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_push_defbranch.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-26 01:39:21 +01:00
|
|
|
tagEdge: true,
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'edge',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'user/app:edge'
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=edge",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_push_defbranch.env',
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'master',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01: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"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_workflow_dispatch.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-25 15:32:14 +01:00
|
|
|
tagEdge: true,
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'edge',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-25 02:25:23 +01: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 01:39:21 +01:00
|
|
|
[
|
|
|
|
'event_push.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'dev',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01: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 15:32:14 +01:00
|
|
|
[
|
|
|
|
'event_push_defbranch.env',
|
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tagEdge: true,
|
2020-10-25 15:32:14 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'edge',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 15:32:14 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:edge',
|
|
|
|
'ghcr.io/user/app:edge'
|
2020-10-25 15:32:14 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=edge",
|
2020-10-25 15:32:14 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_push.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tagSha: true,
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'dev',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:dev',
|
|
|
|
'org/app:sha-90dd603',
|
|
|
|
'ghcr.io/user/app:dev',
|
|
|
|
'ghcr.io/user/app:sha-90dd603'
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=dev",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_push_defbranch.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tagSha: true,
|
|
|
|
tagEdge: true,
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'edge',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:edge',
|
|
|
|
'org/app:sha-90dd603',
|
|
|
|
'ghcr.io/user/app:edge',
|
|
|
|
'ghcr.io/user/app:sha-90dd603'
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=edge",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-25 15:13:43 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_push.env',
|
2020-10-25 15:13:43 +01:00
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tagSha: true,
|
|
|
|
tagEdge: true,
|
|
|
|
tagEdgeBranch: 'dev'
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'edge',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 15:13:43 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:edge',
|
|
|
|
'org/app:sha-90dd603',
|
|
|
|
'ghcr.io/user/app:edge',
|
|
|
|
'ghcr.io/user/app:sha-90dd603'
|
2020-10-25 15:13:43 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=edge",
|
2020-10-25 15:13:43 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_push_defbranch.env',
|
2020-10-25 15:13:43 +01:00
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tagSha: true,
|
|
|
|
tagEdge: true,
|
|
|
|
tagEdgeBranch: 'dev'
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'master',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 15:13:43 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:master',
|
|
|
|
'org/app:sha-90dd603',
|
|
|
|
'ghcr.io/user/app:master',
|
|
|
|
'ghcr.io/user/app:sha-90dd603'
|
2020-10-25 15:13:43 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=master",
|
2020-10-25 15:13:43 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
2020-12-08 00:01:39 +01:00
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_push_invalidchars.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tagSha: true,
|
|
|
|
tagEdge: true,
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'my-feature-1245',
|
|
|
|
partial: [],
|
|
|
|
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 15:13:43 +01:00
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-26 01:39:21 +01:00
|
|
|
])('given %p event ', tagsLabelsTest);
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('push tag', () => {
|
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_tag_release1.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'release1',
|
|
|
|
partial: [],
|
2020-10-28 18:25:31 +01:00
|
|
|
latest: true
|
2020-10-26 01:39:21 +01:00
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-28 18:25:31 +01:00
|
|
|
'user/app:release1',
|
|
|
|
'user/app:latest'
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-25 02:25:23 +01: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"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_tag_20200110-RC2.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '20200110-RC2',
|
|
|
|
partial: [],
|
2020-10-28 18:25:31 +01:00
|
|
|
latest: true
|
2020-10-26 01:39:21 +01:00
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-28 18:25:31 +01:00
|
|
|
'user/app:20200110-RC2',
|
|
|
|
'user/app:latest'
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=20200110-RC2",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_tag_20200110-RC2.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-27 00:57:32 +01:00
|
|
|
tagMatch: `\\d{8}`,
|
2020-12-01 06:29:34 +01:00
|
|
|
tagLatest: false,
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '20200110',
|
|
|
|
partial: [],
|
2020-10-27 00:57:32 +01:00
|
|
|
latest: false
|
2020-10-26 01:39:21 +01:00
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-27 00:57:32 +01:00
|
|
|
'user/app:20200110'
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.title=Hello-World",
|
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
2020-10-27 02:32:26 +01:00
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-27 02:32:26 +01: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"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_tag_20200110-RC2.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tagMatch: `(.*)-RC`,
|
|
|
|
tagMatchGroup: 1,
|
2020-12-01 06:29:34 +01:00
|
|
|
tagLatest: false,
|
2020-10-27 02:32:26 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '20200110',
|
|
|
|
partial: [],
|
2020-10-27 02:32:26 +01: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 02:25:23 +01:00
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
2020-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=20200110",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_tag_v1.1.1.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2020-10-27 00:57:32 +01:00
|
|
|
tagMatch: `\\d{1,3}.\\d{1,3}.\\d{1,3}`,
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01: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"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tagMatch: `^v(\\d{1,3}.\\d{1,3}.\\d{1,3})$`,
|
|
|
|
tagMatchGroup: 1,
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.1.1',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:1.1.1',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.1.1',
|
|
|
|
'ghcr.io/user/app:latest'
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=1.1.1",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2020-10-27 00:57:32 +01:00
|
|
|
tagMatch: `\\d{1,3}.\\d{1,3}.\\d{1,3}-(alpha|beta).\\d{1,3}`,
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '2.0.8-beta.67',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01: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 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=2.0.8-beta.67",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2020-10-27 00:57:32 +01:00
|
|
|
tagMatch: `\\d{1,3}.\\d{1,3}`,
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '2.0',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:2.0',
|
2020-10-25 02:25:23 +01:00
|
|
|
'org/app:latest',
|
2020-10-26 01:39:21 +01:00
|
|
|
'ghcr.io/user/app:2.0',
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=2.0",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-11-17 23:31:03 +01:00
|
|
|
[
|
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tagMatch: `^v(\\d{1,3}.\\d{1,3}.\\d{1,3})$`,
|
|
|
|
tagMatchGroup: 1,
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'v2.0.8-beta.67',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:v2.0.8-beta.67',
|
|
|
|
'ghcr.io/user/app:v2.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=v2.0.8-beta.67",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-26 01:39:21 +01:00
|
|
|
[
|
|
|
|
'event_tag_sometag.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2020-10-27 00:57:32 +01:00
|
|
|
tagMatch: `\\d{1,3}.\\d{1,3}`,
|
2020-10-26 01:39:21 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'sometag',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:sometag',
|
|
|
|
'ghcr.io/user/app:sometag'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=sometag",
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-11-17 23:31:03 +01:00
|
|
|
[
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tagSemver: ['{{version}}', '{{major}}.{{minor}}', '{{major}}'],
|
|
|
|
} 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 01:10:05 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tagSemver: ['{{version}}', '{{major}}.{{minor}}.{{patch}}'],
|
|
|
|
} 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-17 23:31:03 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2020-11-20 23:12:14 +01:00
|
|
|
tagSemver: ['{{major}}.{{minor}}', '{{major}}'],
|
2020-11-17 23:31:03 +01: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 05:50:39 +01:00
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_tag_sometag.env',
|
|
|
|
{
|
|
|
|
images: ['ghcr.io/user/app'],
|
|
|
|
tagSemver: ['{{version}}', '{{major}}.{{minor}}', '{{major}}'],
|
2020-12-01 06:29:34 +01:00
|
|
|
tagLatest: false,
|
2020-12-01 05:50:39 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'sometag',
|
|
|
|
partial: [],
|
2020-12-01 06:29:34 +01:00
|
|
|
latest: false
|
2020-12-01 05:50:39 +01:00
|
|
|
} as Version,
|
|
|
|
[
|
2020-12-01 06:29:34 +01:00
|
|
|
'ghcr.io/user/app:sometag'
|
2020-12-01 05:50:39 +01: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-17 23:31:03 +01:00
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-26 01:39:21 +01:00
|
|
|
])('given %p event ', tagsLabelsTest);
|
|
|
|
});
|
|
|
|
|
2020-10-26 17:51:00 +01:00
|
|
|
describe('latest', () => {
|
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
|
|
|
[
|
|
|
|
'event_tag_release1.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-27 00:57:32 +01:00
|
|
|
tagMatch: `^release\\d{1,2}`,
|
2020-10-26 17:51:00 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'release1',
|
|
|
|
partial: [],
|
2020-10-26 17:51:00 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 17:51:00 +01: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"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_tag_20200110-RC2.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-27 00:57:32 +01:00
|
|
|
tagMatch: `^\\d+-RC\\d{1,2}`,
|
2020-10-26 17:51:00 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '20200110-RC2',
|
|
|
|
partial: [],
|
2020-10-26 17:51:00 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 17:51:00 +01: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"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_tag_20200110-RC2.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-27 00:57:32 +01:00
|
|
|
tagMatch: `\\d{8}`,
|
2020-10-26 17:51:00 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '20200110',
|
|
|
|
partial: [],
|
2020-10-26 17:51:00 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 17:51:00 +01: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"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-27 00:57:32 +01:00
|
|
|
tagMatch: `\\d{1,3}.\\d{1,3}.\\d{1,3}`,
|
2020-10-26 17:51:00 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '1.1.1',
|
|
|
|
partial: [],
|
2020-10-26 17:51:00 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 17:51:00 +01: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"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'v1.1.1',
|
|
|
|
partial: [],
|
2020-10-28 18:25:31 +01:00
|
|
|
latest: true
|
2020-10-26 17:51:00 +01:00
|
|
|
} as Version,
|
|
|
|
[
|
2020-10-27 00:57:32 +01:00
|
|
|
'org/app:v1.1.1',
|
2020-10-28 18:25:31 +01:00
|
|
|
'org/app:latest',
|
2020-10-27 00:57:32 +01:00
|
|
|
'ghcr.io/user/app:v1.1.1',
|
2020-10-28 18:25:31 +01:00
|
|
|
'ghcr.io/user/app:latest',
|
2020-10-26 17:51:00 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-27 00:57:32 +01:00
|
|
|
"org.opencontainers.image.version=v1.1.1",
|
2020-10-26 17:51:00 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2020-10-27 00:57:32 +01:00
|
|
|
tagMatch: `\\d{1,3}.\\d{1,3}.\\d{1,3}`,
|
2020-10-26 17:51:00 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '2.0.8',
|
|
|
|
partial: [],
|
2020-10-26 17:51:00 +01:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
2020-10-27 00:57:32 +01:00
|
|
|
'org/app:2.0.8',
|
2020-10-26 17:51:00 +01:00
|
|
|
'org/app:latest',
|
2020-10-27 00:57:32 +01:00
|
|
|
'ghcr.io/user/app:2.0.8',
|
2020-10-26 17:51:00 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-27 00:57:32 +01:00
|
|
|
"org.opencontainers.image.version=2.0.8",
|
2020-10-26 17:51:00 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-31 19:52:55 +01:00
|
|
|
[
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2020-12-01 06:29:34 +01:00
|
|
|
tagLatest: false,
|
2020-10-31 19:52:55 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'v1.1.1',
|
|
|
|
partial: [],
|
2020-10-31 19:52:55 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-31 19:52:55 +01: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 16:30:57 +01:00
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/MyUSER/MyApp'],
|
2020-12-01 06:29:34 +01:00
|
|
|
tagLatest: false,
|
2020-11-20 16:30:57 +01: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-10-31 19:52:55 +01:00
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-26 17:51:00 +01:00
|
|
|
])('given %p event ', tagsLabelsTest);
|
|
|
|
});
|
|
|
|
|
2020-10-26 01:39:21 +01:00
|
|
|
describe('pull_request', () => {
|
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
|
|
|
[
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'pr-2',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01: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"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'pr-2',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01: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 02:25:23 +01:00
|
|
|
[
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tagSha: true,
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'pr-2',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-25 02:25:23 +01: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-26 01:39:21 +01:00
|
|
|
])('given %p event ', tagsLabelsTest);
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('schedule', () => {
|
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_schedule.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['user/app'],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'nightly',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'user/app:nightly'
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=nightly",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_schedule.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['user/app'],
|
|
|
|
tagSchedule: `{{date 'YYYYMMDD'}}`
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '20200110',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'user/app:20200110'
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=20200110",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_schedule.env',
|
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['user/app'],
|
|
|
|
tagSchedule: `{{date 'YYYYMMDD-HHmmss'}}`
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '20200110-003000',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'user/app:20200110-003000'
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=20200110-003000",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_schedule.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'nightly',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:nightly',
|
|
|
|
'ghcr.io/user/app:nightly'
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=nightly",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_schedule.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tagSha: true,
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'nightly',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:nightly',
|
2020-10-25 02:25:23 +01:00
|
|
|
'org/app:sha-90dd603',
|
2020-10-26 01:39:21 +01:00
|
|
|
'ghcr.io/user/app:nightly',
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-26 01:39:21 +01:00
|
|
|
"org.opencontainers.image.version=nightly",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-26 01:39:21 +01:00
|
|
|
])('given %p event ', tagsLabelsTest);
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('release', () => {
|
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_release.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['user/app'],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'v1.1.1',
|
|
|
|
partial: [],
|
2020-10-28 18:25:31 +01:00
|
|
|
latest: true
|
2020-10-26 01:39:21 +01:00
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-27 00:57:32 +01:00
|
|
|
'user/app:v1.1.1',
|
2020-10-28 18:25:31 +01:00
|
|
|
'user/app:latest',
|
2020-10-25 02:25:23 +01: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-10-31 20:21:22 +01:00
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-10-27 00:57:32 +01:00
|
|
|
"org.opencontainers.image.version=v1.1.1",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
|
|
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
|
|
|
"org.opencontainers.image.licenses=MIT"
|
|
|
|
]
|
|
|
|
],
|
2020-10-26 01:39:21 +01:00
|
|
|
])('given %p event ', tagsLabelsTest);
|
2020-10-25 02:25:23 +01:00
|
|
|
});
|
2020-12-04 18:12:39 +01:00
|
|
|
|
|
|
|
describe('custom', () => {
|
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
|
|
|
[
|
|
|
|
'event_push.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tagCustom: ['my', 'custom', 'tags']
|
|
|
|
} 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"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_push.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tagCustom: ['my']
|
|
|
|
} 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"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_tag_release1.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tagCustom: ['my', 'custom', 'tags']
|
|
|
|
} 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"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_tag_20200110-RC2.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tagMatch: `\\d{8}`,
|
|
|
|
tagLatest: false,
|
|
|
|
tagCustom: ['my', 'custom', 'tags']
|
|
|
|
} 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"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tagSemver: ['{{version}}', '{{major}}.{{minor}}', '{{major}}'],
|
|
|
|
tagCustom: ['my', 'custom', 'tags']
|
|
|
|
} 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"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tagSemver: ['{{version}}', '{{major}}.{{minor}}.{{patch}}'],
|
|
|
|
tagCustom: ['my', 'custom', 'tags'],
|
|
|
|
tagCustomOnly: true,
|
|
|
|
} 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"
|
|
|
|
]
|
|
|
|
],
|
|
|
|
])('given %p event ', tagsLabelsTest);
|
|
|
|
});
|