Best way to upgrade Lucee via script

When updating Lucee intstalls on many servers, I currently have a powershell script that will runs through these steps

  • stop the lucee service
  • copy the lco file over to lucee\tomcat\lucee-server\patches
  • update the sql jdbc driver, otherwise integrated security on 64 bit doesn’t work
  • install if not exists the Tomcat Native library(64-bit)
  • install/update cfspreadsheet plugin
  • start the service

This seems to work for us well so far when updating a hundred servers.

I would like to expand this and update from Oracle JDK to OpenJDK, tomcat, and the boncode connector as well. Are there any easy wins to accomplish upgrading those.

You can probably leverage chocolatey to install tomcat and openjdk…
https://chocolatey.org

Has tomcat packages, plus openjdk, zulu, corretto…

As for boncode, not sure, perhaps running msiexec with appropriate silent flags?

Can’t use chocolatey, due to firewall and no outbound internet on some of the servers.

Boncode can be used without installing it. Just include the bin folder in your web root and add cfm/cfc handlers to your web.config. We include both in our source repos.

See the last few sections of this (now quite old) blog post for more detail.

Your PS script sounds impressive! Would love to know more.

I like that idea of including the boncode dll files directly, I’ll give that a shot in my updater. After this batch of changes I’ll see if I can share it either here or on a gist post.

But you’re obviously providing the artifacts somehow.

Just download the chocolatey install script and run it locally:

tools\chocolateyinstall.ps1

$packageName = $env:ChocolateyPackageName
$targetDir   = 'C:\Program Files\Corretto'
$url64       = 'https://d3pxv6yz143wms.cloudfront.net/8.212.04.1/amazon-corretto-8.212.04.1-windows-x64-jdk.zip'
$checksum64  = 'e041513afec9ddea6976a62a19f31a0f'
 
Install-ChocolateyZipPackage $packageName $url64 $targetDir
Install-ChocolateyEnvironmentVariable 'JAVA_HOME' $targetDir\jdk1.8.0_212 'Machine'
# The full path instead of the %JAVA_HOME% is needed so it can be removed with the Chocolatey Uninstall
Install-ChocolateyPath 'C:\Program Files\Corretto\jdk1.8.0_212\bin' -PathType 'Machine'

Then just download the package yourself and provide a local repo to install it from.

Oh I guess I didn’t consider the local repo option before, currently having powershell download the files from a whitelisted url or local network share.

Updating the JRE and Tomcat (within the same version) is as easy as replacing some files. We do that pretty regularly.