mirror of
https://github.com/docker/metadata-action.git
synced 2025-07-05 01:38:24 +02:00
Allow custom value for semver and match type
This commit is contained in:
@ -496,6 +496,68 @@ describe('push', () => {
|
||||
"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"
|
||||
]
|
||||
]
|
||||
])('given %p with %p event', tagsLabelsTest);
|
||||
});
|
||||
|
||||
|
@ -33,7 +33,8 @@ describe('transform', () => {
|
||||
"enable": "true",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"pattern": "{{version}}"
|
||||
"pattern": "{{version}}",
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -44,7 +45,8 @@ describe('transform', () => {
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"pattern": "\\d{1,3}.\\d{1,3}.\\d{1,3}",
|
||||
"group": "0"
|
||||
"group": "0",
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -149,7 +151,8 @@ describe('parse', () => {
|
||||
"enable": "true",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"pattern": "{{version}}"
|
||||
"pattern": "{{version}}",
|
||||
"value": ""
|
||||
}
|
||||
} as Tag,
|
||||
false
|
||||
@ -163,7 +166,23 @@ describe('parse', () => {
|
||||
"enable": "true",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"pattern": "{{version}}"
|
||||
"pattern": "{{version}}",
|
||||
"value": ""
|
||||
}
|
||||
} as Tag,
|
||||
false
|
||||
],
|
||||
[
|
||||
`type=semver,priority=1,enable=true,pattern={{version}},value=v1.0.0`,
|
||||
{
|
||||
type: Type.Semver,
|
||||
attrs: {
|
||||
"priority": "1",
|
||||
"enable": "true",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"pattern": "{{version}}",
|
||||
"value": "v1.0.0"
|
||||
}
|
||||
} as Tag,
|
||||
false
|
||||
@ -178,7 +197,8 @@ describe('parse', () => {
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"pattern": "v(.*)",
|
||||
"group": "1"
|
||||
"group": "1",
|
||||
"value": ""
|
||||
}
|
||||
} as Tag,
|
||||
false
|
||||
@ -193,7 +213,8 @@ describe('parse', () => {
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"pattern": "^v(\\d{1,3}.\\d{1,3}.\\d{1,3})$",
|
||||
"group": "1"
|
||||
"group": "1",
|
||||
"value": ""
|
||||
}
|
||||
} as Tag,
|
||||
false
|
||||
@ -208,7 +229,24 @@ describe('parse', () => {
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"pattern": "v(.*)",
|
||||
"group": "1"
|
||||
"group": "1",
|
||||
"value": ""
|
||||
}
|
||||
} as Tag,
|
||||
false
|
||||
],
|
||||
[
|
||||
`type=match,enable=true,pattern=v(.*),group=1,value=v1.2.3`,
|
||||
{
|
||||
type: Type.Match,
|
||||
attrs: {
|
||||
"priority": DefaultPriorities[Type.Match],
|
||||
"enable": "true",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"pattern": "v(.*)",
|
||||
"group": "1",
|
||||
"value": "v1.2.3"
|
||||
}
|
||||
} as Tag,
|
||||
false
|
||||
|
Reference in New Issue
Block a user