Skip to content

lucee/script-runner

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Lucee Ant Script Runner

Quickly run Lucee cfml applications headless (without a http server) via the command line

CI

Please report any issues, etc in the Lucee Issue Tracker

Command line Usage

Default ant will run the sample/index.cfm file

image

You can specify:

  • Lucee version -DluceeVersion= (default 5.4.2.17 )
  • Lucee version by query -DluceeVersionQuery="5.4/stable/light
  • Webroot -Dwebroot= (default tests/)
  • CFML Script to run, -Dexecute= (default /index.cfm)
  • run script via include or _internalRequest (which runs the Application.cfc if present, default ) -DexecuteScriptByInclude="true"
  • any extra extensions -Dextensions= (default ``)
  • manual extension install (*.lex) from a directory -DextensionDir= (default ``)
  • compile all cfml under webroot -Dcompile="true"

ant -DluceeVersion="6.0.0.95-SNAPSHOT" -Dwebroot="C:\work\lucee-docs" -Dexecute="import.cfm" -Dlucee.extensions=""

ant -DluceeVersion="6.0.0.95-SNAPSHOT" -DextensionDir="C:\work\lucee-extensions\extension-hibernate\dist"

If no webroot is specfied, you can run the provided debug script, to see which extensions are available and all the env / sys properties

ant -buildfile="C:\work\script-runner" -Dexecute="/debug.cfm"

ant -buildfile="C:\work\script-runner" -Dexecute="/debug.cfm" -DluceeVersion="light-6.0.0.95-SNAPSHOT" (light has no bundled extensions)

As a GitHub Action

To use as a GitHub Action, to run the PDF tests after building the PDF Extension, just add the following yaml

    - name: Checkout Lucee
      uses: actions/checkout@v2
      with:
        repository: lucee/lucee
        path: lucee
    - name: Cache Maven packages
      uses: actions/cache@v3
      with:
        path: ~/.m2
        key: lucee-script-runner-maven-cache
    - name: Cache Lucee files
      uses: actions/cache@v3
      with:
        path: _actions/lucee/script-runner/main/lucee-download-cache
        key: lucee-downloads
    - name: Run Lucee Test Suite
      uses: lucee/script-runner@main
      with:
        webroot: ${{ github.workspace }}/lucee/test
        execute: /bootstrap-tests.cfm
        luceeVersion: ${{ env.luceeVersion }}
        luceeVersionQuery: 5.4/stable/light (optional, overrides luceeVersion)
        extensions: (optional list of extension guids to install)
        extensionDir: ${{ github.workspace }}/dist
        antFlags: -d or -v etc (optional, good for debugging any ant issues)
        compile: true (optional, compiles all the cfml under the webroot)
      env:
        testLabels: pdf
        testAdditional: ${{ github.workspace }}/tests

https://github.com/lucee/extension-pdf/blob/master/.github/workflows/main.yml

This will do the following steps

  • checkout a copy of the Lucee Code base
  • install any extension(s) (*.lex) found in ${{ github.workspace }}/dist
  • run all tests with the label of "pdf"
  • run any additional tests found in the /tests directory of the current repository

As a BitBucket Pipeline

image: atlassian/default-image:3

pipelines:
  default:
    - step:
        name: Build and Test
        caches:
          - maven
        script:
          - ant -noinput -verbose -buildfile build.xml
        artifacts:
          - dist/**
    - step:
        name: Checkout Lucee Script-runner, Lucee and run tests
        script:
          - git clone https://github.com/lucee/script-runner
          - git clone https://github.com/lucee/lucee
          - export testLabels="PDF"
          - echo $testLabels
          - ant -buildfile script-runner/build.xml -DluceeVersion="light-6.0.0.152-SNAPSHOT" -Dwebroot="$BITBUCKET_CLONE_DIR/lucee/test" -DextensionDir="$BITBUCKET_CLONE_DIR/dist" -Dexecute="/bootstrap-tests.cfm" -DtestAdditional="$BITBUCKET_CLONE_DIR/tests"