Skip to content

Commit a1da22f

Browse files
authored
Merge pull request #50 from lucee/LDEV-5377-tomcat11
LDEV-5377 use tomcat 11 for express builds for versions above 6.2.0
2 parents d443de5 + 708a182 commit a1da22f

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

apps/updateserver/services/legacy/S3.cfc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,14 @@ component {
523523
var expressTemplates = getExpressTemplates(); // at this point it should be already cached in the application scope
524524
// unpack the lucee tomcat template
525525
var local_tomcat_templates = curr & "build/servers"
526-
if ( checkVersionGTE( arguments.version, 6, 2 ) ) {
526+
if ( checkVersionGTE( arguments.version, 6, 2, 1 ) ) {
527+
systemOutput("Using Tomcat 11", true);
528+
zip action="unzip" file="#local_tomcat_templates#/#expressTemplates['tomcat-11']#" destination=tmpTom;
529+
} else if ( checkVersionGTE( arguments.version, 6, 2 ) ) {
530+
systemOutput("Using Tomcat 10", true);
527531
zip action="unzip" file="#local_tomcat_templates#/#expressTemplates['tomcat-10']#" destination=tmpTom;
528532
} else {
533+
systemOutput("Using Tomcat 9", true);
529534
zip action="unzip" file="#local_tomcat_templates#/#expressTemplates['tomcat-9']#" destination=tmpTom;
530535
}
531536

@@ -622,12 +627,15 @@ component {
622627
return temp;
623628
}
624629

625-
private function checkVersionGTE( version, major, minor ){
630+
private function checkVersionGTE( version, major, minor, patch="" ){
626631
var v = listToArray( arguments.version, "." );
627632
if ( v[ 1 ] gt arguments.major ) {
628633
return true;
629634
} else if ( v[ 1 ] eq arguments.major && v[ 2 ] gte arguments.minor ) {
630-
return true;
635+
if ( len( arguments.patch ) )
636+
return v[ 3 ] gte arguments.patch;
637+
else
638+
return true;
631639
}
632640
return false;
633641
}

apps/updateserver/services/legacy/expressTemplates.cfc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ component {
1919
var local_templates = directoryList( path=expressLocal, listInfo="query" );
2020
// figure out the latest templates for Tomcat 9 and 10
2121
var express_templates = {};
22+
var express_versions = "lucee-tomcat-9.0.,lucee-tomcat-10.1.,lucee-tomcat-11.0.";
2223
var versions = [];
2324
// https://cdn.lucee.org/express-templates/lucee-tomcat-9.0.100-template.zip
2425
// https://cdn.lucee.org/express-templates/lucee-tomcat-10.1.36-template.zip
25-
loop list="lucee-tomcat-9.0.,lucee-tomcat-10.1." item="local.tomcat_major" {
26+
loop list="#express_versions#" item="local.tomcat_major" {
2627
versions = [];
2728
loop query="#s3_templates#" {
2829
if ( s3_templates.name contains tomcat_major
@@ -55,8 +56,8 @@ component {
5556
}
5657
}
5758

58-
if ( structCount( express_templates ) neq 2 )
59-
throw "Expected 2 express templates: [#express_templates.toJson()#]";
59+
if ( structCount( express_templates ) neq listLen( express_versions ) )
60+
throw "Expected #listLen(express_versions)# express templates: [#express_templates.toJson()#], i.e. [#express_versions#]";
6061
return express_templates;
6162
}
6263

0 commit comments

Comments
 (0)