<commit_before>h1. Travis - a distributed build system

Travis is an attemp 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":http://groups.google.com/group/travis-app and check out my introductional blog post over here: "Travis - a distributed build server tool for the Ruby community":http://svenfuchs.com/2011/2/5/travis-a-distributed-build-server-tool-for-the-ruby-community


h2. Overview

Travis consists of four main parts:

* A "Backbone.js":http://documentcloud.github.com/backbone 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":https://github.com/defunkt/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 (spike 2)":http://www.youtube.com/watch?v=mNOwCJhjWAw

!https://github.com/svenfuchs/travis/raw/master/docs/travis.spike-2.png!


h2. Goals

* 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.


h2. Status

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":http://travis-ci.org which uses

* "RedisToGo":http://redistogo.com as a Redis store
* "Pusher":http://pusherapp.com as a Websocket server
* A virtual server granted by "Avarteq":http://avarteq.de for running a "Resque":http://github.com/defunkt/resque worker.

Each of these components could be replaced with something else, e.g. one could easily use a different Redis server.


h2. Usage

Currently one can sign in via 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 for the following URL: @http://[YOUR_GITHUB_USERNAME]:[YOUR_TRAVIS_TOKEN]@@@travis-ci.org/builds@

You can get a Travis token on the Travis profile page by signing in to your application via Github OAuth2.

One can check in a file @.travis.yml@ in order to specify a custom build script (by default @rake@ will be executed). See "this file":https://github.com/svenfuchs/routing-filter/blob/master/.travis.yml as an example.

Please note that this is an experimental installation.


h2. Installation

To install your own instance of Travis you need to supply various configuration settings:

<pre>
$ cp config/travis.example.yml config/travis.yml
</pre>

In order to push these settings to Heroku you can use:

<pre>
$ rake heroku:config
</pre>

Starting a local worker:

<pre>
$ RAILS_ENV=production VERBOSE=true QUEUE=builds rake resque:work
</pre>

Or using God:

<pre>
$ cp config/resque.god.example config/resque.god
$ god -c config/resque.god
</pre>


h2. Running the tests

Integration tests are implemented using "Jasmine":http://pivotal.github.com/jasmine and can be run in the browser:

<pre>
$ RAILS_ENV=jasmine rake db:migrate db:fixtures:load
$ rails s thin -e jasmine
$ open http://localhost:3000
</pre>

To run the unit tests simply do:

<pre>
$ ruby -Ilib -Itest test/all.rb
</pre>


h2. Previous spike

My first spike was using Nanite for running workers. These materials are now outdated but might be interesting:

* "1:36 quick demo screencast (spike 1)":http://www.youtube.com/watch?v=qdTV-b6BJHA
* "Architecture diagram (spike 1)":https://github.com/svenfuchs/travis/raw/master/docs/travis.spike-1.png


<commit_msg>updated the readme to explain how to get a project setup on travis, and where to find us on irc if your have problems<commit_after>h1. Travis - a distributed build system

Travis is an attemp 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":http://groups.google.com/group/travis-app and check out my introductional blog post over here: "Travis - a distributed build server tool for the Ruby community":http://svenfuchs.com/2011/2/5/travis-a-distributed-build-server-tool-for-the-ruby-community


h2. Overview

Travis consists of four main parts:

* A "Backbone.js":http://documentcloud.github.com/backbone 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":https://github.com/defunkt/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 (spike 2)":http://www.youtube.com/watch?v=mNOwCJhjWAw

!https://github.com/svenfuchs/travis/raw/master/docs/travis.spike-2.png!


h2. Goals

* 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.


h2. Status

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":http://travis-ci.org which uses

* "RedisToGo":http://redistogo.com as a Redis store
* "Pusher":http://pusherapp.com as a Websocket server
* A virtual server granted by "Avarteq":http://avarteq.de for running a "Resque":http://github.com/defunkt/resque worker.

Each of these components could be replaced with something else, e.g. one could easily use a different Redis server.


h2. Adding a project to Travis

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: @http://[YOUR_GITHUB_USERNAME]:[YOUR_TRAVIS_TOKEN]@@@travis-ci.org/builds@

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 @rake@ 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.

See "this file":https://github.com/svenfuchs/routing-filter/blob/master/.travis.yml used by svenfuchs/routing-filter as an example.

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.


h2. Installation

To install your own instance of Travis you need to supply various configuration settings:

<pre>
$ cp config/travis.example.yml config/travis.yml
</pre>

In order to push these settings to Heroku you can use:

<pre>
$ rake heroku:config
</pre>

Starting a local worker:

<pre>
$ RAILS_ENV=production VERBOSE=true QUEUE=builds rake resque:work
</pre>

Or using God:

<pre>
$ cp config/resque.god.example config/resque.god
$ god -c config/resque.god
</pre>


h2. Running the tests

Integration tests are implemented using "Jasmine":http://pivotal.github.com/jasmine and can be run in the browser:

<pre>
$ RAILS_ENV=jasmine rake db:migrate db:fixtures:load
$ rails s thin -e jasmine
$ open http://localhost:3000
</pre>

To run the unit tests simply do:

<pre>
$ ruby -Ilib -Itest test/all.rb
</pre>


h2. Previous spike

My first spike was using Nanite for running workers. These materials are now outdated but might be interesting:

* "1:36 quick demo screencast (spike 1)":http://www.youtube.com/watch?v=qdTV-b6BJHA
* "Architecture diagram (spike 1)":https://github.com/svenfuchs/travis/raw/master/docs/travis.spike-1.png



{'fraction_non_alphanumeric': 0.07711855043641587, 'fraction_numerical': 0.007623467020218761, 'mean_word_length': 4.394517282479142, 'pattern_counts': {'":': 28, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 8, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '566359', 'n_tokens_mistral': 2737, 'n_tokens_neox': 2634, 'n_words': 1174}