Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
371be1e
add support for unique working dir
zspitzer Sep 8, 2025
61e712d
ad support for using a locally built jar using -DluceeJar=/path/to/jar
zspitzer Sep 8, 2025
820a1b9
add docs about using SystemOutput()
zspitzer Sep 8, 2025
61a2c1b
improve execute documentation and examples
zspitzer Sep 9, 2025
8a3bd15
Update README.md
zspitzer Sep 9, 2025
c903915
improve webroot handling, add tests
zspitzer Sep 13, 2025
25b546a
Update webroot-matrix.yml
zspitzer Sep 13, 2025
84089e0
Update webroot-matrix.yml
zspitzer Sep 13, 2025
3debfa9
Update webroot-matrix.yml
zspitzer Sep 13, 2025
d893991
Update webroot-matrix.yml
zspitzer Sep 13, 2025
a55a07a
Update webroot-matrix.yml
zspitzer Sep 13, 2025
434fde2
Update webroot-matrix.yml
zspitzer Sep 13, 2025
db251db
Update webroot-matrix.yml
zspitzer Sep 13, 2025
5c1adcd
Update webroot-matrix.yml
zspitzer Sep 13, 2025
da655e9
Update build.xml
zspitzer Sep 13, 2025
400da8d
Update webroot-matrix.yml
zspitzer Sep 13, 2025
051d3ba
Update webroot-matrix.yml
zspitzer Sep 13, 2025
88a9509
Update webroot-matrix.yml
zspitzer Sep 13, 2025
eef735f
Update webroot-matrix.yml
zspitzer Sep 13, 2025
42601f6
Update webroot-matrix.yml
zspitzer Sep 13, 2025
7a8e076
Update webroot-matrix.yml
zspitzer Sep 13, 2025
c668ddd
Update webroot-matrix.yml
zspitzer Sep 13, 2025
55036e7
Update webroot-matrix.yml
zspitzer Sep 13, 2025
5ab324b
Update webroot-matrix.yml
zspitzer Sep 13, 2025
c1531bd
Update build.xml
zspitzer Sep 13, 2025
cdeb83c
cleanup webroot tests
zspitzer Sep 13, 2025
9776171
Update webroot-matrix.yml
zspitzer Sep 13, 2025
e28feb7
Update webroot-matrix.yml
zspitzer Sep 13, 2025
53f8628
Update build.xml
zspitzer Sep 13, 2025
e4eb50a
Update build.xml
zspitzer Sep 13, 2025
cba70b6
Update build.xml
zspitzer Sep 13, 2025
b2b2433
Update webroot-matrix.yml
zspitzer Sep 13, 2025
39dbd79
Update webroot-matrix.yml
zspitzer Sep 13, 2025
28a80f9
Update webroot-matrix.yml
zspitzer Sep 13, 2025
2420595
Update webroot-matrix.yml
zspitzer Sep 13, 2025
2d1ab78
Update webroot-matrix.yml
zspitzer Sep 13, 2025
83dd095
Update webroot-matrix.yml
zspitzer Sep 13, 2025
afaee4d
Update webroot-matrix.yml
zspitzer Sep 13, 2025
daa48b9
escape windows cmd webroots
zspitzer Sep 13, 2025
5ec8e01
fall back on repeating
zspitzer Sep 13, 2025
1dcabdf
Update webroot-matrix.yml
zspitzer Sep 13, 2025
c6a67f8
Update webroot-matrix.yml
zspitzer Sep 13, 2025
0b2f3fd
Update webroot-matrix.yml
zspitzer Sep 13, 2025
3fd0d83
Update webroot-matrix.yml
zspitzer Sep 13, 2025
c003248
Update webroot-matrix.yml
zspitzer Sep 13, 2025
f7af627
Update webroot-matrix.yml
zspitzer Sep 13, 2025
9410f4c
Update webroot-matrix.yml
zspitzer Sep 13, 2025
0f8020a
Update webroot-matrix.yml
zspitzer Sep 13, 2025
4d536e5
Update webroot-matrix.yml
zspitzer Sep 13, 2025
c6a1c06
Update webroot-matrix.yml
zspitzer Sep 13, 2025
b178c8b
Update webroot-matrix.yml
zspitzer Sep 13, 2025
8d2af47
Update webroot-matrix.yml
zspitzer Sep 13, 2025
d4527a4
Update webroot-matrix.yml
zspitzer Sep 13, 2025
0c0a932
Update webroot-matrix.yml
zspitzer Sep 13, 2025
a4e68ac
Update webroot-matrix.yml
zspitzer Sep 13, 2025
58c0000
Update webroot-matrix.yml
zspitzer Sep 13, 2025
d115bc9
Update webroot-matrix.yml
zspitzer Sep 13, 2025
369f900
Update webroot-matrix.yml
zspitzer Sep 13, 2025
65f6595
add jfr support, cleanup readme, add examples
zspitzer Oct 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ jobs:
run: ant -DluceeVersionQuery="6/all/jar" -Dexecute="/debug.cfm"

- name: Run Lucee 6 Stable
run: ant -DluceeVersion="6.0.3.1" -Dexecute="/debug.cfm" -Dtruth="cfml rocks" -Dauthor="Zac Spitzer"
run: ant -DluceeVersion="6.2.2.91" -Dexecute="/debug.cfm" -Dtruth="cfml rocks" -Dauthor="Zac Spitzer"

- name: Run Lucee 5 (using Lucee light, no extensions)
run: ant -DluceeVersion="light-5.4.2.17" -Dexecute="/debug.cfm"

- name: Run Lucee 6 (using Lucee zero, no extensions, no admin, no docs)
run: ant -DluceeVersion="zero-6.0.3.1" -Dexecute="/debug.cfm"
run: ant -DluceeVersion="zero-6.2.2.91" -Dexecute="/debug.cfm"

- name: Run Latest Lucee 5 RC Light
run: ant -DluceeVersionQuery="5/rc/light" -Dexecute="/debug.cfm"
Expand All @@ -48,3 +48,9 @@ jobs:
- name: Run Latest Stable Lucee 5, compile webroot (invalid code)
continue-on-error: true
run: ant -DluceeVersionQuery="5/stable/jar" -Dexecute="/index.cfm" -Dcompile="true" -Dwebroot="${{ github.workspace }}/sampleBad/"

- name: Test concurrent execution with unique working directories
run: |
ant -DuniqueWorkingDir="true" -Dexecute="/debug.cfm" &
ant -DuniqueWorkingDir="true" -Dexecute="/debug.cfm" &
wait
228 changes: 228 additions & 0 deletions .github/workflows/webroot-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
name: Webroot Handling Matrix
on:
push:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
macos-bash:
name: MacOS Bash
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Run all webroot/execute combinations
shell: bash
env:
LUCEE_VERSION_QUERY: 7/all/zero
working-directory: ${{ github.workspace }}/tests/webroot
run: |
luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}"
pwd
webroots=( '.' "${{ github.workspace }}/tests/webroot" )
executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' )
failed=0
for w in "${webroots[@]}"; do
for e in "${executes[@]}"; do
echo "ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery"
ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery"
if [ $? -ne 0 ]; then
failed=1
platform="macos-latest"
shell="bash"
echo -e "## Platform: $platform | Shell: $shell\n(pwd): $(pwd)\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY"
fi
done
done
exit $failed
ubuntu-bash:
name: Ubuntu Bash
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Run all webroot/execute combinations
shell: bash
env:
LUCEE_VERSION_QUERY: 7/all/zero
working-directory: ${{ github.workspace }}/tests/webroot
run: |
luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}"
pwd
webroots=( '.' "${{ github.workspace }}/tests/webroot" )
executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' )
failed=0
for w in "${webroots[@]}"; do
for e in "${executes[@]}"; do
echo "ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery"
ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery"
if [ $? -ne 0 ]; then
failed=1
platform="ubuntu-latest"
shell="bash"
echo -e "## Platform: $platform | Shell: $shell\n(pwd): $(pwd)\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY"
fi
done
done
exit $failed

windows-cmd:
name: Windows CMD
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Run all webroot/execute combinations
shell: cmd
env:
LUCEE_VERSION_QUERY: 7/all/zero
working-directory: ${{ github.workspace }}/tests/webroot
run: |
@echo off
setlocal enabledelayedexpansion
for %%w in (.) do (
for %%e in (index.cfm test.cfm sub\test.cfm) do (
echo %%w / %%e
ant -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY%
if errorlevel 1 (
set cmd=ant -buildfile=build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY%
echo FAILED: %%w / %%e: !cmd!>> %GITHUB_STEP_SUMMARY%
echo(>> %GITHUB_STEP_SUMMARY%
exit /b 1
)
)
)
for %%w in ("%GITHUB_WORKSPACE%\tests\webroot") do (
for %%e in (index.cfm test.cfm sub/test.cfm) do (
ant -buildfile=..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY%
if errorlevel 1 (
set cmd=ant -buildfile=build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY%
echo FAILED: %%w / %%e: !cmd!>> %GITHUB_STEP_SUMMARY%
echo(>> %GITHUB_STEP_SUMMARY%
exit /b 1
)
)
)

endlocal
windows-pwsh:
name: Windows PowerShell
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Run all webroot/execute combinations
shell: pwsh
env:
LUCEE_VERSION_QUERY: 7/all/zero
working-directory: ${{ github.workspace }}/tests/webroot
run: |
$webroots = @('.', "${{ github.workspace }}\tests\webroot")
pwd
$executes = @('index.cfm', 'test.cfm', 'sub/test.cfm')
foreach ($w in $webroots) {
foreach ($e in $executes) {
$luceeVersionQuery = $env:LUCEE_VERSION_QUERY
$cmd = "ant -buildfile=../../build.xml `"-Dwebroot=$w`" `"-Dexecute=$e`" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery"
Write-Host $cmd
$LASTEXITCODE = 0
iex $cmd
if ($LASTEXITCODE -ne 0) {
$cmd = "ant -buildfile=../../build.xml `"-Dwebroot=$w`" `"-Dexecute=$e`" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery"
$platform = "windows-latest"
$shell = "pwsh"
$summary = @()
$summary += "## Platform: $platform | Shell: $shell"
$summary += "(pwd): $(pwd)"
$summary += "### $cmd"
$summary += "FAILED: $w / $e"
$summary -join "`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY
}
}
}
windows-bash:
name: Windows Bash
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Run all webroot/execute combinations
shell: bash
env:
LUCEE_VERSION_QUERY: 7/all/zero
working-directory: ${{ github.workspace }}/tests/webroot
run: |
luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}"
webroots=( '.' "${{ github.workspace }}/tests/webroot" )
executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' )
failed=0
for w in "${webroots[@]}"; do
for e in "${executes[@]}"; do
echo "ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery"
ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery"
if [ $? -ne 0 ]; then
failed=1
platform="windows-latest"
shell="bash"
echo -e "## Platform: $platform | Shell: $shell\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY"
fi
done
done
exit $failed
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
lucee-download-cache
temp
bin
logs
/temp-unique
/agent-tests
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Changelog

All notable changes to the Lucee Script Runner project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- **Local JAR Support**: Added `luceeJar` parameter to test locally built Lucee JARs without publishing
- Accepts full path to a local JAR file
- Overrides both `luceeVersion` and `luceeVersionQuery`
- Perfect for Lucee core developers testing builds
- **Unique Working Directories**: Added `uniqueWorkingDir` parameter with three modes:
- `false` (default): Uses standard temp/lucee directory
- `true`: Auto-generates unique directory with timestamp and random ID
- Custom path: Uses specified directory path
- **Concurrent Execution Support**: Multiple script-runner instances can now run simultaneously without conflicts
- **Race Condition Detection**: Automatic detection and prevention of directory conflicts
- **Improved JFR Logging**:
- JFR files now output to organized `logs/` directory
- Descriptive filenames: `timestamp-lucee-version-webroot-script-javaversion.jfr`
- Added `logs/` to `.gitignore`
- **Enhanced Error Messages**:
- Git Bash path conversion detection with specific solutions
- Execute script validation with exact file path shown
- Windows trailing backslash validation
- **Cross-Platform Path Handling**: Robust path concatenation logic for Windows and Unix systems

### Changed
- **Updated Lucee Version**: Standardized all references to version 6.2.2.91 across codebase
- **JFR Filename Format**: Changed from `lucee-version.jar-javaversion.jfr` to descriptive format with timestamp and context
- **Documentation**: Updated README.md with comprehensive working directory behavior explanations

### Fixed
- **File Path Validation Bug**: Fixed concatenation logic for execute script validation
- **Git Bash Path Conversion Issues**: Added detection and helpful error messages for MSYS path conversion problems
- **Build Script Path Resolution**: Fixed relative path issues when using unique working directories

### Technical Details

#### New Ant Properties
- `uniqueWorkingDir`: Controls working directory behavior
- `webroot.name`: Extracted basename of webroot for JFR filenames
- `execute.clean`: Cleaned execute path (removes leading slashes) for JFR filenames
- `execute.fullpath`: Properly concatenated full path for file validation

#### Build Process Improvements
- Added `set-unique-working-dir` target with timestamp generation and race condition checks
- Enhanced `run-cfml` target with improved validation and path handling
- Updated GitHub Actions workflow with concurrent execution tests

#### Error Handling
- Early validation of execute script existence under webroot
- Specific error messages for common Git Bash issues
- Clear guidance on workarounds and solutions

### Migration Notes
- Existing usage remains unchanged (backward compatible)
- New JFR files will appear in `logs/` directory instead of project root
- Git users should add `logs/` to their `.gitignore` if not already present
Loading
Loading