-
Notifications
You must be signed in to change notification settings - Fork 0
/
taggingStrategy.js
78 lines (78 loc) · 2.89 KB
/
taggingStrategy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// [expected output, object passed to taggingStrategy function]
exports.scenarios = [
[
'1,1.0,1.0.0',
{inputTags:'%X%,%X.Y%,%X.Y.Z%', tagName:'1.0.0'}
],
[
'1.0.0',
{inputTags:'%X%::false,%X.Y%::false,%X.Y.Z%', tagName:'1.0.0'}
],
[
'foo/bar:1,foo/bar:1.0,foo/bar:1.0.0',
{inputTags:'%X%,%X.Y%,%X.Y.Z%::true', tagName:'1.0.0', imageName: 'foo/bar'}
],
[
'foo/bar:1,foo/bar:1.0.0',
{inputTags:'%X%,%X.Y%::\'false\',%X.Y.Z%::\'true\'', tagName:'1.0.0', imageName: 'foo/bar'}
],
[
'foo/bar:1,foo/bar:1.0.0',
{inputTags:'%X%,%X.Y%::\'false\',%X.Y.Z%::true', tagName:'1.0.0', imageName: 'foo/bar'}
],
[
'foo/bar:1,foo/bar:1.0,foo/bar:1.0.0',
{inputTags:'%X%,%X.Y%,%X.Y.Z%', tagName:'1.0.0', imageName: 'foo/bar' }
],
[
'foo/bar:1.0,foo/bar:1.0.0',
{inputTags:'%X%::false,%X.Y%::true,%X.Y.Z%::\'true\'', tagName:'1.0.0', imageName: 'foo/bar'}
],
[
'1,1.0,1.0.0',
{inputTags:'%X%,%X.Y%,%X.Y.Z%', tagName:'1.0.0'}
],
[
'1-foobar,1.0-foobar,1.0.0-foobar',
{inputTags:'%X%-foobar,%X.Y%-foobar,%X.Y.Z%-foobar', tagName:'1.0.0'}
],
[
'1-foobar,1.0-foobar,1.0.0-foobar',{inputTags:'%X%-foobar,%X.Y%-foobar,%X.Y.Z%-foobar', tagName:'1.0.0'}
],
[
'hello/world:1-foobar,hello/world:1.0-foobar,hello/world:1.0.0-foobar',
{inputTags:'%X%-foobar,%X.Y%-foobar,%X.Y.Z%-foobar', tagName:'1.0.0', imageName: 'hello/world'}
],
[
'hello/world:1-foobar,hello/world:1.0.0-foobar',
{inputTags:'%X%-foobar,%X.Y%-foobar::false,%X.Y.Z%-foobar', tagName:'1.0.0', imageName: 'hello/world'}
],
[
'1-rc1,1.0-rc1,1.0.0-rc1',
{inputTags:'%X%,%X.Y%,%X.Y.Z%', tagName:'1.0.0rc1'}
],
[
'1-rc1-foobar,1.0-rc1-foobar,1.0.0-rc1-foobar',
{inputTags:'%X%-foobar,%X.Y%-foobar,%X.Y.Z%-foobar', tagName:'1.0.0rc1'}
],
[
'hello/world:1-rc1-foobar,hello/world:1.0-rc1-foobar,hello/world:1.0.0-rc1-foobar',
{inputTags:'%X%-foobar,%X.Y%-foobar,%X.Y.Z%-foobar', tagName:'1.0.0rc1', imageName: 'hello/world'}
],
[
'hello/world:1-rc1-foobar,hello/world:1.0-rc1-foobar,hello/world:1.0.0-rc1-foobar',
{inputTags:'%X%-foobar,%X.Y%-foobar,%X.Y.Z%-foobar', tagName:'1.0.0rc1', imageName: 'hello/world'}
],
[
'hello/world:1-rc1-foobar,hello/world:1.0-rc1-foobar,hello/world:1.0.0-rc1-foobar',
{inputTags:'%X%-foobar,%X.Y%-foobar,%X.Y.Z%-foobar', tagName:'1.0.0rc1', imageName: 'hello/world'}
],
[
'hello/world:1-rc1-foobar,hello/world:1.0-rc1-foobar,hello/world:1.0.0-rc1-foobar,hello/world:latest,hello/world:edge',
{inputTags:'%X%-foobar,%X.Y%-foobar,%X.Y.Z%-foobar', tagName:'1.0.0rc1', imageName: 'hello/world', extraTags: 'latest,edge'}
],
[
'hello/world:1-rc1-foobar,hello/world:1.0-rc1-foobar,hello/world:1.0.0-rc1-foobar,hello/world:edge',
{inputTags:'%X%-foobar,%X.Y%-foobar,%X.Y.Z%-foobar', tagName:'1.0.0rc1', imageName: 'hello/world', extraTags: 'latest::false,edge::true'}
],
]