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
If you are interested in Travis please subscribe to the Google group and check out my introductional blog post over here: Travis – a distributed build server tool for the Ruby community
Travis consists of four main parts:
- A Backbone.js single-page application that runs client side.
- A Rails 3 application that serves to the in-browser application and takes pings from Github.
- A Resque worker for running a project’s test suite remotely.
- A websocket server for tailing build results to the browser. (This server is currently started within the Rails app process.)
To get an idea: 1:20 quick demo screencast
- Get a working application up and running that can distribute build requests to manually installed build workers and report back to browsers. Most simplistic UI that ever would make sense for this. Have a restricted set of allowed Github repositories.
- Allow people to login through Github OAuth and somehow maintain a list of repositories they’re interested in.
- Create VM images so that people can easily install and start build workers on underused or contributed servers.
This code is a spike and everything will change very likely. It is here to try out a few basic concepts and building blocks and ask people to share their opinion.
Nonetheless we currently have a working demo application running on http://travis-ci.org which uses
- RedisToGo as a Redis store
- Pusher as a Websocket server
- A virtual server lent by Avarteq for running a Resque worker.
Each of these components could be replaced with something else, e.g. one could easily use a different Redis server.
Signup is easy, all you need to do is login using Github OAuth2 and an account will automatically be created.
In order to register a project for builds on Travis just supply a Github service hook using the following URL:
You can get a Travis token on the Travis profile page after signing up.
By default Travis will try to run
bundle install and then either
bundle exec rake (if you have a Gemfile) or just
rake (if you do not have a Gemfile) to run yours tests, but if you require a different command to be run to start your tests you can check in a
.travis.yml file to specify a custom build script.
By default Travis will send notification emails to everyone involved in the project on GitHub. You can specify who receives emails in `.travis.yml`:
notifications: recipients: - firstname.lastname@example.org - email@example.com
You can disable email notifications:
notifications: disable: true
If you have any issues, problems, or questions in getting Travis running for your project, you can find us on irc in #travis on freenode.
Please note that this is an experimental installation.
After adding your project to Travis, you can use the status buttons to show the current status of your projects in your
README file on Github or your project website.
Your status button is available at the following URL:
So, when using textile, showing your status button (including a link to your Travis project page) is as simple as adding this to your
Or if you’re using markdown:
You can limit the impact of this button to certain branches only. For example, you might not want to include feature branches, which might fail but don’t mean the project itself fails.
Specify a `?branch=` parameter in the URI. Split branches with a comma if you want to specify several.
Please note : If you are placing this image on a GitHub project status page we recommend you use the SSL enabled url so that GitHub does not proxy and cache the image. The SSL url is:
To install your own instance of Travis you need to supply various configuration settings:
$ cp config/travis.example.yml config/travis.yml
In order to push these settings to Heroku you can use:
$ rake heroku:config
Starting a local worker:
Or using God:
$ cp config/resque.god.example config/resque.god $ god -c config/resque.god
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 test
My first spike was using Nanite for running workers. These materials are now outdated but might be interesting:
- Ruby 1.8.7 or Ruby 1.9.2 (Ruby 1.9.1 is not supported).