├── .gitignore ├── tests ├── ci │ ├── mxunit-ant.jar │ ├── mxunit-output-ant.jar │ ├── scripts │ │ ├── acf9-control.sh │ │ ├── ci-helper-lucee.sh │ │ ├── ci-helper-acf9.sh │ │ ├── ci-helper-acf.sh │ │ ├── ci-helper-acf11.sh │ │ ├── ci-helper-railo.sh │ │ ├── ci-helper-railo-42plus.sh │ │ └── ci-helper-base.sh │ ├── testbox-runner.cfm │ └── HttpAntRunner.cfc ├── mxunit │ └── dummyTest.cfc ├── Application.cfc └── testbox │ └── dummyTest.cfc ├── circle.yml ├── .travis.yml ├── LICENSE.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | /tests/ci/results 2 | /tests/ci/results/* 3 | /WEB-INF 4 | .ant-targets-build.xml -------------------------------------------------------------------------------- /tests/ci/mxunit-ant.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coldfumonkeh/cfml-ci/HEAD/tests/ci/mxunit-ant.jar -------------------------------------------------------------------------------- /tests/ci/mxunit-output-ant.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coldfumonkeh/cfml-ci/HEAD/tests/ci/mxunit-output-ant.jar -------------------------------------------------------------------------------- /tests/mxunit/dummyTest.cfc: -------------------------------------------------------------------------------- 1 | component extends="mxunit.framework.TestCase" { 2 | 3 | public void function setUp() { 4 | } 5 | 6 | public void function testDummy() { 7 | assertTrue(true); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/ci/scripts/acf9-control.sh: -------------------------------------------------------------------------------- 1 | pushd $WORK_DIR/jrun4/bin > /dev/null 2 | case $1 in 3 | start) 4 | ./jrun -start cfusion>/dev/null& 5 | ;; 6 | stop) 7 | ./jrun -stop cfusion>/dev/null& 8 | ;; 9 | esac 10 | popd > /dev/null -------------------------------------------------------------------------------- /tests/Application.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | this.name = 'dummy test'; 3 | 4 | this.mappings['/mxunit'] = getDirectoryFromPath(getCurrentTemplatePath()) & "../../mxunit"; 5 | this.mappings['/tests'] = getDirectoryFromPath(getCurrentTemplatePath()); 6 | this.mappings['/testbox'] = getDirectoryFromPath(getCurrentTemplatePath()) & "../../testbox"; 7 | } 8 | -------------------------------------------------------------------------------- /tests/testbox/dummyTest.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | function run () { 3 | describe("Dummy test", function () { 4 | it("runs a test", function () { 5 | expect(true).toBeTrue(); 6 | }); 7 | /* this is a known failing test 8 | it("fails", function () { 9 | expect(false).toBeTrue(); 10 | }); 11 | */ 12 | }); 13 | } 14 | } -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | environment: 3 | PLATFORM: lucee451 4 | TESTFRAMEWORK: mxunit 5 | DIRTOUSE: $HOME/$CIRCLE_PROJECT_REPONAME 6 | 7 | dependencies: 8 | pre: 9 | - ant -Dtest.framework=$TESTFRAMEWORK -Dsource=remote -Dwork.dir=$DIRTOUSE/work -Dbuild.dir=$DIRTOUSE -Dplatform=$PLATFORM install-ci-deps 10 | 11 | test: 12 | override: 13 | - ant -Dtest.framework=$TESTFRAMEWORK -Dsource=remote -Dwork.dir=$DIRTOUSE/work -Dbuild.dir=$DIRTOUSE -Dplatform=$PLATFORM test-ci 14 | post: 15 | - cp -r $DIRTOUSE/tests/ci/results/ $CIRCLE_TEST_REPORTS 16 | -------------------------------------------------------------------------------- /tests/ci/scripts/ci-helper-lucee.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | case $1 in 3 | start) 4 | CONTROL_SCRIPT='./startup.sh' 5 | ;; 6 | stop) 7 | CONTROL_SCRIPT='./shutdown.sh' 8 | ;; 9 | esac 10 | 11 | PLATFORM_DIR="lucee" 12 | WEBROOT="webapps/ROOT" 13 | MY_DIR=`dirname $0` 14 | source $MY_DIR/ci-helper-base.sh $1 $2 15 | 16 | case $1 in 17 | install) 18 | chmod a+x ./startup.sh 19 | chmod a+x ./shutdown.sh 20 | ;; 21 | start|stop) 22 | ;; 23 | *) 24 | echo "Usage: $0 {install|start|stop}" 25 | exit 1 26 | ;; 27 | esac 28 | 29 | exit 0 -------------------------------------------------------------------------------- /tests/ci/scripts/ci-helper-acf9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PLATFORM_DIR="jrun4" 3 | WEBROOT="jrun4/servers/cfusion/cfusion-ear/cfusion-war" 4 | 5 | MY_DIR=`dirname $0` 6 | CONTROL_SCRIPT="`pwd`/$MY_DIR/acf9-control.sh" 7 | 8 | source $MY_DIR/ci-helper-base.sh $1 $2 9 | 10 | case $1 in 11 | install) 12 | echo "Fixing ACF install directory..." 13 | grep -rl "/opt/jrun4/" --exclude-dir=$WEBROOT . | xargs -n 1 sed -i "s#/opt/jrun4/#$WORK_DIR/jrun4/#g" 14 | 15 | sed -i "s/8300/$SERVER_PORT/g" jrun4/servers/cfusion/SERVER-INF/jrun.xml 16 | ;; 17 | start|stop) 18 | ;; 19 | *) 20 | echo "Usage: $0 {install|start|stop}" 21 | exit 1 22 | ;; 23 | esac 24 | 25 | exit 0 -------------------------------------------------------------------------------- /tests/ci/scripts/ci-helper-acf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CONTROL_SCRIPT='coldfusion10/cfusion/bin/coldfusion' 3 | 4 | PLATFORM_DIR="coldfusion10" 5 | WEBROOT="coldfusion10/cfusion/wwwroot" 6 | MY_DIR=`dirname $0` 7 | source $MY_DIR/ci-helper-base.sh $1 $2 8 | 9 | case $1 in 10 | install) 11 | echo "Fixing ACF install directory..." 12 | grep -rl "/opt/coldfusion10/" --exclude-dir=$WEBROOT . | xargs -n 1 sed -i "s#/opt/coldfusion10/#$WORK_DIR/coldfusion10/#g" 13 | 14 | sed -i "s/8500/$SERVER_PORT/g" coldfusion10/cfusion/runtime/conf/server.xml 15 | ;; 16 | start|stop) 17 | ;; 18 | *) 19 | echo "Usage: $0 {install|start|stop}" 20 | exit 1 21 | ;; 22 | esac 23 | 24 | exit 0 -------------------------------------------------------------------------------- /tests/ci/scripts/ci-helper-acf11.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CONTROL_SCRIPT='coldfusion11/cfusion/bin/coldfusion' 3 | 4 | PLATFORM_DIR="coldfusion11" 5 | WEBROOT="coldfusion11/cfusion/wwwroot" 6 | MY_DIR=`dirname $0` 7 | source $MY_DIR/ci-helper-base.sh $1 $2 8 | 9 | case $1 in 10 | install) 11 | echo "Fixing ACF install directory..." 12 | grep -rl "/opt/coldfusion11/" --exclude-dir=$WEBROOT . | xargs -n 1 sed -i "s#/opt/coldfusion11/#$WORK_DIR/coldfusion11/#g" 13 | 14 | sed -i "s/8500/$SERVER_PORT/g" coldfusion11/cfusion/runtime/conf/server.xml 15 | ;; 16 | start|stop) 17 | ;; 18 | *) 19 | echo "Usage: $0 {install|start|stop}" 20 | exit 1 21 | ;; 22 | esac 23 | 24 | exit 0 25 | -------------------------------------------------------------------------------- /tests/ci/scripts/ci-helper-railo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | case $1 in 3 | start) 4 | CONTROL_SCRIPT='railo/start' 5 | ;; 6 | stop) 7 | CONTROL_SCRIPT='railo/stop' 8 | ;; 9 | esac 10 | 11 | PLATFORM_DIR="railo" 12 | WEBROOT="railo/webapps/www" 13 | MY_DIR=`dirname $0` 14 | source $MY_DIR/ci-helper-base.sh $1 $2 15 | 16 | case $1 in 17 | install) 18 | chmod a+x railo/start 19 | chmod a+x railo/stop 20 | 21 | sed -i "s/jetty.port=8888/jetty.port=$SERVER_PORT/g" railo/start 22 | sed -i "s/STOP.PORT=8887/STOP.PORT=$STOP_PORT/g" railo/start 23 | sed -i "s/STOP.PORT=8887/STOP.PORT=$STOP_PORT/g" railo/stop 24 | ;; 25 | start|stop) 26 | ;; 27 | *) 28 | echo "Usage: $0 {install|start|stop}" 29 | exit 1 30 | ;; 31 | esac 32 | 33 | exit 0 -------------------------------------------------------------------------------- /tests/ci/scripts/ci-helper-railo-42plus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | case $1 in 3 | start) 4 | CONTROL_SCRIPT='railo/start' 5 | ;; 6 | stop) 7 | CONTROL_SCRIPT='railo/stop' 8 | ;; 9 | esac 10 | 11 | PLATFORM_DIR="railo" 12 | WEBROOT="railo/webapps/ROOT" 13 | MY_DIR=`dirname $0` 14 | source $MY_DIR/ci-helper-base.sh $1 $2 15 | 16 | case $1 in 17 | install) 18 | chmod a+x railo/start 19 | chmod a+x railo/stop 20 | 21 | sed -i "s/jetty.port=8888/jetty.port=$SERVER_PORT/g" railo/start 22 | sed -i "s/STOP.PORT=8887/STOP.PORT=$STOP_PORT/g" railo/start 23 | sed -i "s/STOP.PORT=8887/STOP.PORT=$STOP_PORT/g" railo/stop 24 | ;; 25 | start|stop) 26 | ;; 27 | *) 28 | echo "Usage: $0 {install|start|stop}" 29 | exit 1 30 | ;; 31 | esac 32 | 33 | exit 0 -------------------------------------------------------------------------------- /tests/ci/testbox-runner.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: java 3 | env: 4 | matrix: 5 | # currently the only way to do a multi-dimensional env matrix 6 | - PLATFORM=railo40 TESTFRAMEWORK=mxunit 7 | - PLATFORM=railo41 TESTFRAMEWORK=mxunit 8 | - PLATFORM=railo42 TESTFRAMEWORK=mxunit 9 | - PLATFORM=lucee451 TESTFRAMEWORK=mxunit 10 | - PLATFORM=lucee5_beta TESTFRAMEWORK=mxunit 11 | - PLATFORM=acf10-linux64 TESTFRAMEWORK=mxunit 12 | - PLATFORM=acf902-linux64 TESTFRAMEWORK=mxunit 13 | - PLATFORM=railo40 TESTFRAMEWORK=testbox 14 | - PLATFORM=railo41 TESTFRAMEWORK=testbox 15 | - PLATFORM=railo42 TESTFRAMEWORK=testbox 16 | - PLATFORM=lucee5_beta TESTFRAMEWORK=testbox 17 | - PLATFORM=lucee451 TESTFRAMEWORK=testbox 18 | - PLATFORM=acf10-linux64 TESTFRAMEWORK=testbox 19 | 20 | install: ant -Dtest.framework=$TESTFRAMEWORK -Dsource=remote -Dwork.dir=$HOME/work -Dbuild.dir=$TRAVIS_BUILD_DIR -Dplatform=$PLATFORM install-ci-deps 21 | script: ant -Dtest.framework=$TESTFRAMEWORK -Dsource=remote -Dwork.dir=$HOME/work -Dbuild.dir=$TRAVIS_BUILD_DIR -Dplatform=$PLATFORM test-ci 22 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-2014 Marcin Szczepanski 4 | Copyright (c) 2015 Marcin Szczepanski & Matt Gifford 5 | Copyright (c) 2016 Matt Gifford 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /tests/ci/scripts/ci-helper-base.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ ! -n "$WORK_DIR" ]; then 3 | echo "WORK_DIR must be set!" 4 | exit 1 5 | fi 6 | 7 | if [ ! -n "$BUILD_DIR" ]; then 8 | BUILD_DIR=`pwd` 9 | fi 10 | 11 | echo "Working directory: $WORK_DIR, Build directory: $BUILD_DIR" 12 | 13 | if [ ! "$1" == "install" ]; then 14 | 15 | if [ ! -d $WORK_DIR ]; then 16 | echo "Working directory doesn't exist and this isn't an install!" 17 | exit 1 18 | else 19 | cd $WORK_DIR 20 | fi 21 | else 22 | if [ ! -n "$2" ]; then 23 | echo "usage: $0 install PROJECTNAME"; 24 | exit 1 25 | fi 26 | fi 27 | 28 | WGET_OPTS="-nv" 29 | 30 | function download_and_extract { 31 | FILENAME=`echo $1|awk '{split($0,a,"/"); print a[length(a)]}'` 32 | if [[ "$1" == /* ]]; then 33 | echo "Copying $1 to $FILENAME" 34 | cp $1 $FILENAME 35 | else 36 | echo "Downloading $1 to $FILENAME" 37 | wget $WGET_OPTS $1 -O $FILENAME 38 | fi 39 | 40 | if [[ "$FILENAME" == *zip ]]; then 41 | unzip -q $FILENAME 42 | else 43 | tar -zxf $FILENAME 44 | fi 45 | rm $FILENAME 46 | result=$FILENAME 47 | } 48 | 49 | 50 | if [ ! -n "$SERVER_PORT" ]; then 51 | SERVER_PORT="8500" 52 | fi 53 | 54 | HEALTHCHECK_URL="http://localhost:$SERVER_PORT" 55 | 56 | 57 | case $1 in 58 | install) 59 | if [ -d $WORK_DIR ]; then 60 | echo "Removing $WORK_DIR" 61 | rm -rf $WORK_DIR 62 | fi 63 | 64 | mkdir -p $WORK_DIR 65 | cd $WORK_DIR 66 | 67 | download_and_extract $PLATFORM_URL 68 | 69 | # assume platform dir is the only dir 70 | FIRST_DIR=`ls -b` 71 | if [ "$FIRST_DIR" != "$PLATFORM_DIR" ]; then 72 | mv $FIRST_DIR $PLATFORM_DIR 73 | fi 74 | download_and_extract $TESTFRAMEWORK_URL 75 | 76 | case $TESTFRAMEWORK in 77 | mxunit) 78 | mv mxunit* "$WEBROOT/$TESTFRAMEWORK" 79 | ;; 80 | testbox) 81 | mv testbox "$WEBROOT/$TESTFRAMEWORK" 82 | ;; 83 | esac 84 | ln -s $BUILD_DIR $WEBROOT/$2 85 | ;; 86 | start) 87 | if [ ! -f $CONTROL_SCRIPT ]; then 88 | echo "Control script does not exist!" 89 | exit 1 90 | fi 91 | echo "Starting server... ($HEALTHCHECK_URL)" 92 | $CONTROL_SCRIPT start& 93 | until [ "`curl --connect-timeout 2 -m 2 -s -o /dev/null -w "%{http_code}" $HEALTHCHECK_URL`" == "200" ] 94 | do 95 | echo "Waiting for server to start..." 96 | sleep 2 97 | done 98 | ;; 99 | stop) 100 | echo "Stopping server..." 101 | $CONTROL_SCRIPT stop 102 | while curl --connect-timeout 2 --max-time 2 -s $HEALTHCHECK_URL>/dev/null 103 | do 104 | echo "Waiting for server to stop..." 105 | sleep 1 106 | done 107 | ;; 108 | *) 109 | echo "Usage: $0 {install|start|stop}" 110 | exit 1 111 | ;; 112 | esac -------------------------------------------------------------------------------- /tests/ci/HttpAntRunner.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | if(arguments.type is "testcase"){ 18 | suite = createObject("component","mxunit.framework.TestSuite").TestSuite(); 19 | suite.addAll(arguments.value); 20 | results = suite.run(); 21 | } 22 | if(arguments.type is "dir"){ 23 | //To Do: add args for recursion, includes, and excludes 24 | if(not isBoolean(arguments.recurse)){ 25 | arguments.recurse = false; 26 | } 27 | 28 | results = createObject("component","mxunit.runner.DirectoryTestSuite").run(directory=arguments.value, componentPath=arguments.componentPath, recurse=arguments.recurse, excludes=arguments.excludes); 29 | } 30 | //package name for JUnit reports 31 | results.setPackage(arguments.packagename); 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | #trim(arguments.results.getHTMLResults())# 48 | 49 | 50 | #trim(arguments.results.getXMLResults())# 51 | 52 | 53 | #trim(arguments.results.getJUnitXMLResults())# 54 | 55 | #trim(arguments.results.getJUnitXMLResults())# 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | if(arguments.type is "testcase"){ 73 | suite = createObject("component","mxunit.framework.TestSuite").TestSuite(); 74 | suite.addAll(arguments.value); 75 | results = suite.run(); 76 | } 77 | if(arguments.type is "dir"){ 78 | //To Do: add args for recursion, includes, and excludes 79 | if(not isBoolean(arguments.recurse)){ 80 | arguments.recurse = false; 81 | } 82 | 83 | results = createObject("component","DirectoryTestSuite").run(directory=arguments.value, componentPath=arguments.componentPath, recurse=arguments.recurse, excludes=arguments.excludes); 84 | } 85 | //package name for JUnit reports 86 | results.setPackage(arguments.packagename); 87 | 88 | 89 | 90 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/coldfumonkeh/cfml-ci.png?branch=master)](https://travis-ci.org/coldfumonkeh/cfml-ci) 2 | # CFML CI 3 | 4 | A template for integrating CFML projects with [Continous Integration](http://en.wikipedia.org/wiki/Continuous_integration) servers. Extracted from work done for the [Framework One](https://github.com/framework-one/fw1) project. 5 | 6 | Use this template to add to your project so that your test suite gets run under a clean installed ACF or Railo server, and the results are reported on a CI server. 7 | 8 | ## Implementation Guide 9 | 10 | ### Requirement 11 | 12 | * a CI server (eg. [Travis CI](http://travis-ci.org/), [CircleCI](https://circleci.com/), [Jenkins](http://jenkins-ci.org/), [Bamboo](https://www.atlassian.com/software/bamboo), etc) running on Linux or Mac OS X 13 | * a [TestBox](http://wiki.coldbox.org/wiki/TestBox.cfm) or an [MXUnit](http://mxunit.org) based test suite (or the desire to create one) 14 | * [Apache Ant](http://ant.apache.org/) 1.9+ (older versions have a bug with waiting for shell scripts to return) 15 | * awk (not mawk - this was what was on the Debian Jenkins box I was testing with an it does't work), the awk built into Mac OS X is fine 16 | 17 | ### Basic requirements 18 | 19 | To get started adding the CFML CI template to your project: 20 | * you need to copy the `build.xml` into your project, or if you already have a `build.xml` integrate the properties and targets 21 | * if you don't already have tests, copy the whole `tests` directory 22 | * otherwise copy the `ci` directory into your `tests` directory 23 | * customise the properties at the top of the `build.xml` - there's more detail on the various options below 24 | * add the setup and test run command to your CI server (see below) 25 | 26 | #### build.xml properties 27 | 28 | ##### General configuration 29 | 30 | * *test.project*: a short name for your project, this will be used as the context root for installing your project into the test server 31 | * *work.dir*: working directory where the server will be installed - this should be a directory that doesn't already exist as it gets deleted and re-created on every test run, default is /tmp/work 32 | * *build.dir*: directory that gets mapped into the webserver, normally this will probably just be wherever your build.xml is (the default). 33 | 34 | * *test.framework*: whether to use the TestBox or MXUnit test runner for your tests. 35 | 36 | ##### Platforms 37 | 38 | cfml-ci supports Railo (4.0+), Lucee (4.x+) and Adobe ColdFusion (9.0.2, and 10). You can configure the various platforms and the URLs where they will be downloaded from. For Railo, Railo Express is used as the test server as it essentially comes "ready to go" so the download comes from Railo directly. For Adobe ColdFusion an "install" is required, and so ACF has been installed, configured and re-packaged for use by cfml-ci. Downloads for this ACF re-distribution are hosted on S3. 39 | 40 | If you are running cfml-ci in your own CI environment then it is recommended to have locally hosted copies of your target platforms, to avoid a slower download over the Internet. For Travis CI and CircleCI the URLs provided are fast (I assume Travis CI and CircleCI are on AWS as well). 41 | 42 | You can provide both "remote" and "local" URLs (or paths), by default local will be used unless you set the source property when running ant. Either a URL or file path starting with a / is supported for URLs (technically both for remote and local, but it doesn't make sense for remote). 43 | 44 | To add a new platform you need to set the following properties: 45 | 46 | * PLATFORM.local.url 47 | * PLATFORM.remote.url 48 | * PLATFORM.helper 49 | 50 | The "helper" is the shell script that will be used for installing, starting and stopping the server and is found in `tests/ci/scripts`. All helper scripts are of the form `ci-helper-HELPER.sh`, where HELPER is the property. If you need to add your own, see the existing scripts as a reference. 51 | 52 | ### Travis CI 53 | 54 | Travis implementation is relatively straightforward, there are sensible defaults passed in the `.travis.yml` file, and the other defaults in the `build.xml` are generally fine: 55 | 56 | * copy the `.travis.yml` from this project into your repo root 57 | * in Travis CI settings, toggle Travis CI on for your Github repository 58 | * push a commit to Github 59 | * check build status on Travis CI 60 | 61 | ### CircleCI 62 | 63 | The CircleCI implementation is similar to the Travis implementation above (minus the build matrix that tests all CFML engines in the same build): 64 | 65 | * copy the `circle.yml` from this project into your repo root 66 | * in CircleCI, add your Github repository 67 | * push a commit to Github 68 | * check build status on CircleCI 69 | 70 | ### Jenkins 71 | 72 | - **TODO**: update this section after the move to "platforms" 73 | 74 | * Create a new project 75 | * Provide your source repository settings as per usual 76 | * add an "Invoke Ant" build step 77 | * Targets: `install-ci-deps test-ci-railo` 78 | * Advanced -> Properties: 79 | ```work.dir=$WORKSPACE/work``` 80 | 81 | To improve build performance you can load the Railo Express and MXUnit archives onto your build server and use local references for the Railo / MXUnit URLs - under Advanced -> Properties: 82 | 83 | ``` 84 | railo.url=/home/user/railo-express-4.1.1.009-nojre.tar.gz 85 | mxunit.url=/home/user/fix-railo-nulls.zip 86 | ``` 87 | 88 | (This obviously assumes you have put those files under /home/user on your Jenkins server) 89 | 90 | ### Bamboo 91 | 92 | - **TODO**: I don't have a Bamboo install, so either someone else can write this or wait for me to get around to trying a trial! 93 | 94 | ## History 95 | 96 | There really wasn't much out there about integrating CFML projects with CI servers like Jenkins, Bamboo or TravisCI. Recently FW/1 had a pull request merged that "broke the build", which would have been identified if the tests were run. I thought I'd investigate the feasibility of running the FW/1 test suite on Travis CI, and after a few hours hacking managed to get it working. 97 | 98 | There are some limitations to doing this will CFML - the main one is that CFML isn't a standalone language like Ruby or even Java, it (usually) needs to be run through a web server. This means test cases have to be run via HTTP. 99 | 100 | Travis CI, in particular, works on virtual machines that are reset in between test runs - that means for every test run you need to setup the environment for the tests to run in. In the case of CFML, this means getting a web server running for the tests. 101 | 102 | In its initial implementation a copy of [Railo Express](http://www.getrailo.org/index.cfm/download/) is downloaded during the setup phase, mxunit is then downloaded and extracted into the Railo Express webroot and the working copy of the code under test is symlinked in to the webroot. This means when Railo Express starts up everything is configured and ready. 103 | 104 | Support for Adobe ColdFusion 9.0.2 and 10 was added in December 2013, after getting some verbal email based approval from Adobe to repackage a Developer install of Adobe ColdFusion for use with CI. 105 | --------------------------------------------------------------------------------