Travis is an attempt to create an open-source, distributed build system for the Ruby community that:
1. allows open-source projects to register their repository and have their test-suites run on demand
2. allows users to contribute build capacities by connecting a VM that runs a build agent somewhere on their underused servers
Travis consists of several parts:
- A Sprout Core-based single-page application that runs client side.
- A Rails 3 application that serves to the in-browser application and takes pings from Github.
- A JRuby-based AMQP worker for running a project’s test suite in snapshotted virtual machines.
- A websocket server (we use Pusher) for tailing build results to the browser.
- A JRuby-based AMQP daemon that collects build reports, workers state, propagates them to Pusher, delivers notifications and so on.
- Tools that provision CI environment (to provide databases, RabbitMQ, Rubies/JDK/Node.js versions and so on) and build VM images.
All these applications, tools and libraries are hosted under Travis CI github organization.
You can also watch this (old but still valid) screencast to get an idea: 1:20 quick demo screencast
With Travis CI our vision is to become for builds (i.e. tests, for starters) what rubygems.org is for gems.
Our goal is to build a rock solid, but dead-easy to use open-source continuous integration service for the open source community.
We try to follow the 80/20 for requirements. I.e. we focus on the most common use cases.
Travis CI does not currently support closed in-house installations, although we know of people doing this.
Ask on the IRC channel for more information.
Running the tests
Integration tests are implemented using Jasmine and can be run in the browser:
$ RAILS_ENV=jasmine rake db:migrate db:seed $ rails s thin -e jasmine $ open http://localhost:3000
To run the whole test suite simply do:
$ rake spec
Setup is pretty easy. You need to execute 4 steps:
$ bundle $ bundle exec rake travis:setup:config
This will create two files:
./config/database.yml. Edit these files according to your local configuration.
Travis CI is configured to authenticate with OAuth and github. You’ll need to register your application with github (even if it’s only for local development) and complete all the required fields in
./config/travis.yml for your ID and secret.
Next, tell Travis to configure the database:
$ bundle exec rake travis:setup
And finally start the server:
$ bundle exec foreman start
Note that you always start the server using
Travis CI is now up & running on http://localhost:5000
You can also create a default admin user (optional):
$ rake travis:create_admin_user
Application is now up & running on http://localhost:5000
- Travis CI – Video: Presentation at Boston.rb (Jeremy Weisskotten)
- Travis – a distributed build server tool for the Ruby community – Introductory blog post about the original idea (Sven Fuchs)
- Ruby 1.9.2 (Ruby 1.9.1 is not supported)
- PostgreSQL for the pg gem
- VirtualBox 4.1