From e04b4d01a9f8ae7ab62e28b3baaa8ed9fc7741ac Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 30 Mar 2021 13:57:28 +0200 Subject: [PATCH] Cleanup --- __tests__/meta.test.ts | 66 +++++++++++++++++++----------------------- src/meta.ts | 1 - 2 files changed, 29 insertions(+), 38 deletions(-) diff --git a/__tests__/meta.test.ts b/__tests__/meta.test.ts index 03ee290..1d65fde 100644 --- a/__tests__/meta.test.ts +++ b/__tests__/meta.test.ts @@ -557,6 +557,35 @@ describe('push', () => { "org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071", "org.opencontainers.image.licenses=MIT" ] + ], + [ + '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" + ] ] ])('given %p with %p event', tagsLabelsTest); }); @@ -2358,40 +2387,3 @@ describe('bake', () => { expect(JSON.parse(fs.readFileSync(bakeFile, 'utf8'))).toEqual(exBakeDefinition); }); }); - -describe('push', () => { - // prettier-ignore - test.each([ - [ - '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" - ] - ] - ])('given %p with %p event', tagsLabelsTest); -}); diff --git a/src/meta.ts b/src/meta.ts index bd34e51..d6e9268 100644 --- a/src/meta.ts +++ b/src/meta.ts @@ -47,7 +47,6 @@ export class Meta { if (tag.attrs['enable'] == 'false') { continue; } - switch (tag.type) { case tcl.Type.Schedule: { version = this.procSchedule(version, tag);