Travis
Travis CI is one of the most popular CI servers for open source software. At Ortus Solutions, we use it for all of our open source software due to its strength of pull request runners and multi-matrix runners. They have both free and commercial versions, so you can leverage it for private projects as well.

Features

  • FREE for Open Source Projects
  • Runs distributed VM’s and Container Support
  • Triggers Build Script via git repository commits (.travis.yml)
  • Multiple language support
  • Many integrations and extensions
  • Many notification types
  • No ability to schedule/manual builds
  • Great for open source projects!

TestBox Integration

In order to work with Travis you must create a .travis.yml file in the root of your project. Once there are commits in your repository, Travis will process this file as your build file. Please refer to the Travis Documentation for further study.
1
language: java
2
sudo: required
3
dist: trusty
4
5
before_install:
6
# CommandBox Keys
7
- curl -fsSl https://downloads.ortussolutions.com/debs/gpg | sudo apt-key add -
8
- sudo echo "deb https://downloads.ortussolutions.com/debs/noarch /" | sudo tee -a
9
/etc/apt/sources.list.d/commandbox.list
10
11
install:
12
- sudo apt-get update && sudo apt-get --assume-yes install commandbox
13
- box install
14
- box server start
15
16
script:
17
- box testbox run
Copied!
This build file is based on the java language and an Ubuntu Trusty image. We start off by executing the before_install step which installs all the OS dependencies we might need. In our case we add the CommandBox repository server keys and install CommandBox as our dependency. We then move to our install step which makes sure we have all the required software dependencies to execute our tests, again this looks at our box.json for TestBox and required project dependencies. After issuing the box install we move to starting up the CFML engine using box server start and we are ready to test.
1
install:
2
- sudo apt-get update && sudo apt-get --assume-yes install commandbox
3
- box install
4
- box server start
Copied!
The testing occurs in the script block:
1
script:
2
- box testbox run
Copied!
In our script we basically install our dependencies for our project using CommandBox and startup a CFML server. We then go ahead and execute our tests via box testbox run.

Box.json

In order for the box testbox run to execute correctly, our box.json (See https://commandbox.ortusbooks.com/content/packages/boxjson/boxjson.html) in our project must be able to connect to our server and know which tests to execute. Below are all the possiblities for the testbox integration object in CommandBox's box.json. (See https://commandbox.ortusbooks.com/content/testbox-integration.html)
1
{
2
"name" : "Package Name",
3
// ForgeBox unique slug
4
"slug" : "",
5
// semantic version of your package
6
"version" : "1.0.0+buildID",
7
// author of this package
8
"author" : "Luis Majano <[email protected]>",
9
// location of where to download the package, overrides ForgeBox location
10
"location" : "URL,Git/svn endpoint,etc",
11
12
// testbox integration
13
testbox :{
14
// The location of the runner
15
runner : [
16
{ "default": "http://localhost:8080/tests/runner.cfm" }
17
],
18
// Which labels to run, empty means all
19
"labels" : "",
20
// Which reporter to use, default is json
21
"reporter" : "",
22
// Which CFC bundles to execute, default is all
23
"bundles" : "",
24
// Which directories to execute
25
"directory" : "tests.specs",
26
// Recurse the directories for CFCs
27
"recurse" : true,
28
// Which bundles to filter on
29
"testBundles" : "",
30
// Which suites to filter on
31
"testSuites" : "",
32
// Which specs to filter on
33
"testSpecs" : "",
34
// Display extra details inlcuding passing and skipped tests.
35
"verbose" : true,
36
// How may milliseconds to wait before polling for changes, defaults to 500 ms
37
"watchDelay" : 500,
38
// Command delimited list of file globbing paths to watch relative to the working directory
39
"watchPaths" : "**.cfc"
40
}
41
}
Copied!

Online Example: cbVue

You can look at our cbVue sample application online: https://travis-ci.org/coldbox-samples/cbvue which contains all CI server integrations.
Last modified 2yr ago