@@ -28,14 +28,13 @@ const versions = Object.keys(config).reverse()
2828let midnight = new Date ( )
2929midnight . setHours ( 0 , 0 , 0 , 0 )
3030const now = midnight . getTime ( )
31- const aplineRE = new RegExp ( / a l p i n e * / ) ;
31+ const alpineRE = new RegExp ( / a l p i n e * / ) ;
3232const slimRE = new RegExp ( / \* - s l i m / ) ;
3333let foundLTS = false ;
3434let foundCurrent = false ;
3535
36- for ( version of versions ) {
36+ for ( const version of versions ) {
3737 let lts = new Date ( `${ config [ version ] . lts } T00:00:00.00` ) . getTime ( ) ;
38- let maintenance = new Date ( `${ config [ version ] . maintenance } T00:00:00.00` ) . getTime ( ) ;
3938 let isCurrent = foundCurrent ? false : isNaN ( lts ) || lts >= now ;
4039 foundCurrent = isCurrent || foundCurrent ;
4140 let isLTS = foundLTS ? false : ( now >= lts ) ;
@@ -44,53 +43,52 @@ for (version of versions) {
4443 let defaultAlpine = config [ version ] [ 'alpine-default' ]
4544 let defaultDebian = config [ version ] [ 'debian-default' ]
4645 let variants = config [ version ] . variants
47- let fullversion ;
48- for ( variant in variants ) {
46+ for ( const variant in variants ) {
4947 let dockerfilePath = path . join ( version , variant , 'Dockerfile' ) ;
50- let isAlpine = aplineRE . test ( variant )
48+ let isAlpine = alpineRE . test ( variant )
5149 let isSlim = slimRE . test ( variant )
5250 let isDefaultSlim = new RegExp ( `${ defaultDebian } -slim` ) . test ( variant )
5351
5452 // Get full version from the Dockerfile
5553 let dockerfile = fs . readFileSync ( dockerfilePath , 'utf-8' )
56- fullversion = dockerfile . match ( / E N V N O D E _ V E R S I O N = (?< major > \d + ) \. (?< minor > \d + ) \. (?< patch > \d + ) / )
54+ let fullVersion = dockerfile . match ( / E N V N O D E _ V E R S I O N = (?< major > \d + ) \. (?< minor > \d + ) \. (?< patch > \d + ) / )
5755
5856 let tags = [
59- `${ fullversion . groups . major } .${ fullversion . groups . minor } .${ fullversion . groups . patch } -${ variant } ` ,
60- `${ fullversion . groups . major } .${ fullversion . groups . minor } -${ variant } ` ,
61- `${ fullversion . groups . major } -${ variant } ` ,
57+ `${ fullVersion . groups . major } .${ fullVersion . groups . minor } .${ fullVersion . groups . patch } -${ variant } ` ,
58+ `${ fullVersion . groups . major } .${ fullVersion . groups . minor } -${ variant } ` ,
59+ `${ fullVersion . groups . major } -${ variant } ` ,
6260 ]
6361
6462 if ( codename ) {
6563 tags . push ( `${ codename } -${ variant } ` )
6664 }
6765
6866 if ( variant === defaultAlpine ) {
69- tags . push ( `${ fullversion . groups . major } .${ fullversion . groups . minor } .${ fullversion . groups . patch } -alpine` )
70- tags . push ( `${ fullversion . groups . major } .${ fullversion . groups . minor } -alpine` )
71- tags . push ( `${ fullversion . groups . major } -alpine` )
67+ tags . push ( `${ fullVersion . groups . major } .${ fullVersion . groups . minor } .${ fullVersion . groups . patch } -alpine` )
68+ tags . push ( `${ fullVersion . groups . major } .${ fullVersion . groups . minor } -alpine` )
69+ tags . push ( `${ fullVersion . groups . major } -alpine` )
7270 if ( codename ) {
7371 tags . push ( `${ codename } -alpine` )
7472 }
7573 }
7674
7775 if ( variant === defaultDebian ) {
78- tags . push ( `${ fullversion . groups . major } .${ fullversion . groups . minor } .${ fullversion . groups . patch } ` )
79- tags . push ( `${ fullversion . groups . major } .${ fullversion . groups . minor } ` )
80- tags . push ( `${ fullversion . groups . major } ` )
76+ tags . push ( `${ fullVersion . groups . major } .${ fullVersion . groups . minor } .${ fullVersion . groups . patch } ` )
77+ tags . push ( `${ fullVersion . groups . major } .${ fullVersion . groups . minor } ` )
78+ tags . push ( `${ fullVersion . groups . major } ` )
8179 if ( isSlim ) {
82- tags . push ( `${ fullversion . groups . major } .${ fullversion . groups . minor } .${ fullversion . groups . patch } -slim` )
83- tags . push ( `${ fullversion . groups . major } .${ fullversion . groups . minor } -slim` )
84- tags . push ( `${ fullversion . groups . major } -slim` )
80+ tags . push ( `${ fullVersion . groups . major } .${ fullVersion . groups . minor } .${ fullVersion . groups . patch } -slim` )
81+ tags . push ( `${ fullVersion . groups . major } .${ fullVersion . groups . minor } -slim` )
82+ tags . push ( `${ fullVersion . groups . major } -slim` )
8583 }
8684 if ( codename ) {
8785 tags . push ( `${ codename } ` )
8886 }
8987 }
9088 if ( isDefaultSlim ) {
91- tags . push ( `${ fullversion . groups . major } .${ fullversion . groups . minor } .${ fullversion . groups . patch } -slim` )
92- tags . push ( `${ fullversion . groups . major } .${ fullversion . groups . minor } -slim` )
93- tags . push ( `${ fullversion . groups . major } -slim` )
89+ tags . push ( `${ fullVersion . groups . major } .${ fullVersion . groups . minor } .${ fullVersion . groups . patch } -slim` )
90+ tags . push ( `${ fullVersion . groups . major } .${ fullVersion . groups . minor } -slim` )
91+ tags . push ( `${ fullVersion . groups . major } -slim` )
9492 if ( codename ) {
9593 tags . push ( `${ codename } -slim` )
9694 }
@@ -99,9 +97,9 @@ for (version of versions) {
9997 if ( isCurrent ) {
10098 if ( variant === defaultAlpine ) {
10199 tags . push ( variant )
102- tags . push ( `${ fullversion . groups . major } .${ fullversion . groups . minor } .${ fullversion . groups . patch } -alpine` )
103- tags . push ( `${ fullversion . groups . major } .${ fullversion . groups . minor } -alpine` )
104- tags . push ( `${ fullversion . groups . major } -alpine` )
100+ tags . push ( `${ fullVersion . groups . major } .${ fullVersion . groups . minor } .${ fullVersion . groups . patch } -alpine` )
101+ tags . push ( `${ fullVersion . groups . major } .${ fullVersion . groups . minor } -alpine` )
102+ tags . push ( `${ fullVersion . groups . major } -alpine` )
105103 tags . push ( 'alpine' )
106104 tags . push ( 'current-alpine' )
107105 }
@@ -126,8 +124,6 @@ for (version of versions) {
126124
127125 if ( isLTS ) {
128126 tags . push ( `lts-${ variant } ` )
129- if ( variant === defaultAlpine ) {
130- }
131127 if ( variant === defaultDebian ) {
132128 tags . push ( 'lts' )
133129 if ( codename ) {
0 commit comments