Build Lucee Installer #79
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Lucee Installer | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
LUCEE_VERSION: | |
required: true | |
type: string | |
# Triggers the workflow on push or pull request events but only for the master branch | |
workflow_call: | |
inputs: | |
LUCEE_VERSION: | |
required: true | |
type: string | |
DRY_RUN: | |
required: false | |
default: false | |
type: boolean | |
repository_dispatch: | |
types: [build-installers] | |
env: | |
LUCEE_INSTALLER_VERSION: ${{ github.event.inputs.LUCEE_VERSION }} | |
IB_URL: https://releases.installbuilder.com/installbuilder/installbuilder-enterprise-24.3.0-linux-x64-installer.run | |
IB_NAME: installbuilder-enterprise-24.3.0-linux-x64-installer.run | |
lucee_build_version: 6.1.1.60-SNAPSHOT | |
jobs: | |
build-installers: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download and Install InstallBuilder | |
run: | | |
curl ${{ env.IB_URL }} -o ${{ env.IB_NAME }} | |
ls -l | |
chmod a+x ${{ env.IB_NAME }} | |
echo "running installer...." | |
./${{ env.IB_NAME }} --prefix /tmp/ib --mode unattended | |
- name: Update Template with version | |
run : | | |
cat lucee/lucee.xml.template | sed -e "s,<version>LUCEE_VERSION</version>,<version>${{ env.LUCEE_INSTALLER_VERSION }}</version>," > lucee/lucee.xml | |
- name: Write out license | |
env: | |
INSTALLBUILDER_LICENSE: ${{ secrets.INSTALLBUILDER_LICENSE }} | |
shell: bash | |
run: | | |
echo "$INSTALLBUILDER_LICENSE" >> lucee/license.xml | |
- name: Download Lucee Jar | |
run: | | |
curl --fail https://cdn.lucee.org/lucee-${{ env.LUCEE_INSTALLER_VERSION }}.jar -o lucee-${{ env.LUCEE_INSTALLER_VERSION }}.jar -s | |
pwd | |
ls -l | |
mv lucee-${{ env.LUCEE_INSTALLER_VERSION }}.jar lucee/lucee/lib/ | |
- name: Cache Maven packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: lucee-script-runner-maven-cache | |
- name: Download latest Tomcat and Java | |
uses: lucee/script-runner@main | |
with: | |
webroot: ${{ github.workspace }}/ | |
execute: /download-latest-java-tomcat.cfm | |
luceeVersion: ${{ env.lucee_build_version }} | |
- name: Prepare Tomcat Linux | |
run: | | |
pwd | |
cd lucee/tomcat9/ | |
rm -rf tomcat | |
cd ../.. | |
pwd | |
ls -l | |
mv src-tomcat/linux lucee/tomcat9/tomcat | |
cp -ar lucee/tomcat9/tomcat-lucee-conf/* lucee/tomcat9/tomcat | |
ls -lRh | |
- name: Build Lucee Installer - Linux x64 | |
run: | | |
cd lucee | |
/tmp/ib/bin/builder build lucee.xml linux-x64 --verbose --license license.xml | |
- name: Prepare Tomcat Windows | |
run: | | |
cd lucee/tomcat9/ | |
rm -rfv tomcat | |
cd ../.. | |
pwd | |
ls -l | |
mv src-tomcat/windows lucee/tomcat9/tomcat | |
cp -ar lucee/tomcat9/tomcat-lucee-conf/* lucee/tomcat9/tomcat | |
ls -lRh | |
- name: Build Lucee Installer - Windows x64 | |
run: | | |
cd lucee | |
/tmp/ib/bin/builder build lucee.xml windows-x64 --verbose --license license.xml | |
- name: check linux installer has correct version | |
run: | | |
ls -laht /tmp/ib/output/ | |
/tmp/ib/output/lucee-${{ env.LUCEE_INSTALLER_VERSION }}-linux-x64-installer.run --version | |
out=`/tmp/ib/output/lucee-${{ env.LUCEE_INSTALLER_VERSION }}-linux-x64-installer.run --version` | |
tet="Lucee ${{ env.LUCEE_INSTALLER_VERSION }}" | |
if [[ $out != $tet* ]] | |
then | |
echo Incorrect version banner | |
exit 1 | |
fi | |
- name: Upload Artifact - Linux Installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lucee-installer-${{ env.LUCEE_INSTALLER_VERSION }}-linux-run | |
path: /tmp/ib/output/*.run | |
retention-days: 1 | |
compression-level: 0 | |
- name: Upload Artifact - Windows Installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lucee-installer-${{ env.LUCEE_INSTALLER_VERSION }}-windows | |
path: /tmp/ib/output/*.exe | |
retention-days: 1 | |
compression-level: 0 | |
test-linux: | |
runs-on: ubuntu-latest | |
needs: build-installers | |
steps: | |
- name: Download Linux Installer artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: lucee-installer-${{ env.LUCEE_INSTALLER_VERSION }}-linux-run | |
- name: list dir | |
run: | | |
ls -l | |
- name: Run Linux installer | |
run: | | |
ls -l | |
chmod +x lucee-${{ env.LUCEE_INSTALLER_VERSION }}-linux-x64-installer.run | |
sudo ./lucee-${{ env.LUCEE_INSTALLER_VERSION }}-linux-x64-installer.run \ | |
--mode unattended --prefix /tmp/lucee --installconn false --installmodcfml false --installiis false --startatboot false \ | |
--luceepass ibtest --systemuser $USER --installjre true | |
sleep 5; | |
echo "<cfscript>if (server.lucee.version neq url.version) header statuscode='500' statustext='wrong version #server.lucee.version#'; echo('## Lucee Linux ' & server.lucee.version & ', using java ' & server.java.version);</cfscript>" > /tmp/lucee/tomcat/webapps/ROOT/check.cfm | |
curl http://127.0.0.1:8888/check.cfm?version=${{ env.LUCEE_INSTALLER_VERSION }} --fail-with-body -o $GITHUB_STEP_SUMMARY | |
#sleep 5 | |
#sudo /tmp/lucee/lucee_ctl stop | |
- name: debug failure | |
if: ${{ failure() }} | |
run: | | |
cat /tmp/lucee/tomcat/logs/catalina.out | |
#cat /tmp/lucee/install.log | |
cd /tmp/lucee | |
ls -lR | |
#cat /tmp/lucee/tomcat/lucee-server/context/logs/out.log | |
#cat /tmp/lucee/tomcat/lucee-server/context/logs/err.log | |
#cat /tmp/lucee/tomcat/logs/catalina.out | |
test-windows: | |
runs-on: windows-latest | |
needs: build-installers | |
steps: | |
- name: Download Windows Installer artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: lucee-installer-${{ env.LUCEE_INSTALLER_VERSION }}-windows | |
- name: list dir | |
run: | | |
dir | |
- name: Run Windows Installer | |
shell: cmd | |
run: | | |
cd | |
lucee-${{ env.LUCEE_INSTALLER_VERSION }}-windows-x64-installer.exe --mode unattended --installconn false --installmodcfml false --installiis false --startatboot false --luceepass ibtest --installjre true | |
curl http://127.0.0.1:8888/index.cfm --fail-with-body -o $GITHUB_STEP_SUMMARY | |
echo "Lucee Windows installer ${{ env.LUCEE_INSTALLER_VERSION }}" >> $GITHUB_STEP_SUMMARY | |
- name: debug failure | |
if: ${{ failure() }} | |
run: | | |
dir -s $home\ | |
type $home\lucee\tomcat\logs\catalina.out | |
type $home\lucee\install.log | |
publish-to-s3: | |
runs-on: ubuntu-latest | |
needs: [ test-windows, test-linux, build-installers ] | |
if: ${{ github.event.inputs.DRY_RUN != true }} | |
env: | |
S3_ACCESS_ID_DOWNLOAD: ${{ secrets.S3_ACCESS_ID_DOWNLOAD }} | |
S3_SECRET_KEY_DOWNLOAD: ${{ secrets.S3_SECRET_KEY_DOWNLOAD }} | |
steps: | |
- uses: actions/[email protected] | |
- name: Download Windows Installer artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: lucee-installer-${{ env.LUCEE_INSTALLER_VERSION }}-windows | |
- name: Download Linux Installer artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: lucee-installer-${{ env.LUCEE_INSTALLER_VERSION }}-linux-run | |
- name: Cache Maven packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: lucee-script-runner-maven-cache | |
- name: Publish Installers to S3 | |
uses: lucee/script-runner@main | |
with: | |
webroot: ${{ github.workspace }}/ | |
execute: /publish-to-s3.cfm | |
luceeVersion: ${{ env.lucee_build_version }} |