T
Travis CI
A Distributed Build Platform for Open Source
Continuous Integration is a software
development practice where members
    of a team integrate their work
frequently ... verified by an automated
    build (including test) to detect
           integration errors
                         - Martin Fowler
Travis CI is ...

• An Open Source
• Distributed
• Build System
• for the Open Source Community
Open Source ...
• Brain child of Sven Fuchs
 • travis.heroku.com (December, 2010)
• Travis-CI (and subprojects) are open source
 • github.com/travis-ci
 • 20 members and growing
• Considered “Alpha” (but very functional)
Distributed ...
        allows users to contribute build
      capacities by connecting a VM that
    runs a build agent somewhere on their
               underused servers


• Travis-CI -- the web application runs on Heroku
• But Travis workers,VMs that run the builds, are
  contributed by users
Build System ...
Build System ...

           repo

git push
Build System ...

           repo
                         travis
git push          hook
Build System ...

           repo
                         travis
git push          hook
                                  tasks
Build System ...

           repo
                         travis
git push          hook                    task
                                  tasks
Build System ...
                         git clone

           repo
                           travis
git push          hook                       task
                                     tasks
Build System ...
                         git clone

           repo                      status
                           travis
git push          hook                         task
                                       tasks
Build System ...
                         git clone

           repo                      status
                           travis
git push          hook                         task
                                       tasks
Build System ...
                         git clone

           repo                      status
                           travis
git push          hook                         task
                                       tasks
                          updates
Open Source Community
 • Travis CI is free to use for any public
   GitHub project
 • Travis is great for any Ruby project
But Can Also Build ...


   clojure
Getting Started ...

1. Sign up with Travis CI using
   your GitHub account
2. Enable the repositories that
   you want Travis to build
git push
A Travis Worker Builds
    Your Project...

$ rvm use 1.8.7

$ git clone git://github.com/YOUR/PROJECT.git

$ bundle install --path vendor/bundle

$ bundle exec rake
Announce Your Build
      Status!

• Status Images
• E-mail Notifications
• IRC Notifications
E-mail Notification ...
Build Matrix ...
• Defined by your .travis.yml
• Configure ...
 • Ruby versions (rvm)
 • Custom Gemfiles
 • Environment Variables
• Script to run
Jsonify .travis.yml
rvm:
  - 1.9.3
  - 1.9.2
  - 1.8.7
  - jruby
  - rbx-2.0
env:
  - RAILS_VERSION='~>3.0.0'
  - RAILS_VERSION='>=3.1.0'
Jsonify .travis.yml
                    10
rvm:
  - 1.9.3
  - 1.9.2
                        Builds
  - 1.8.7
  - jruby
  - rbx-2.0
env:
  - RAILS_VERSION='~>3.0.0'
  - RAILS_VERSION='>=3.1.0'
But Wait ...
          There’s More!
• before / after scripts
• matrix exclusion
  matrix: { exclusion: [{ rvm: 1.8.7, env:RG=1.3.6 }]}


• specify branches to build (white/blacklist)
  # blacklist
  branches:
    except:
      - legacy
      - experimental
Built-in DB Support
        SQLite3
                           MySQL
PostgreSQL
               MongoDB
    All Available with no extra setup required
What about ? ? ?
What about ? ? ?
 Redis
             sphinx   memcached

          CouchDB python
OpenJDK
                 ImageMagick
 Selenium     Riak
Vanity .travis.yml
rvm:
 - 1.8.7
 - 1.9.2
gemfile:
 - Gemfile
env:
 - DB=mongodb
 - DB=redis
 - DB=mysql
before_script:
 - "mysql -e 'create database vanity_test;' >/dev/null"
The “Hosh” Factor
The “Hosh” Factor
What metrics do you use when evaluating
       gems and applications?
The “Hosh” Factor
What metrics do you use when evaluating
       gems and applications?

• GitHub watchers and forks
• RubyGems.org download count
• Recent commit activity
• Travis Build Status and History
In the works ...
  • RabbitMQ replacing Resque
  • SproutCore replacing Backbone.js
  • Travis API
  • Private Repos*
               Sven’s Mantra
“Do the simplest thing possible then Improve”
Interesting Svenisms ...

•   simple_states
•   data_migrations
•   hashr
Get Involved ...

1. put your apps on Travis
2. about.travis-ci.org
3. #travis on freenode
Is This Travis ?
Travis the Tractor
Travis Bickle

Travis CI

  • 1.
    T Travis CI A DistributedBuild Platform for Open Source
  • 2.
    Continuous Integration isa software development practice where members of a team integrate their work frequently ... verified by an automated build (including test) to detect integration errors - Martin Fowler
  • 3.
    Travis CI is... • An Open Source • Distributed • Build System • for the Open Source Community
  • 4.
    Open Source ... •Brain child of Sven Fuchs • travis.heroku.com (December, 2010) • Travis-CI (and subprojects) are open source • github.com/travis-ci • 20 members and growing • Considered “Alpha” (but very functional)
  • 5.
    Distributed ... allows users to contribute build capacities by connecting a VM that runs a build agent somewhere on their underused servers • Travis-CI -- the web application runs on Heroku • But Travis workers,VMs that run the builds, are contributed by users
  • 6.
  • 7.
    Build System ... repo git push
  • 8.
    Build System ... repo travis git push hook
  • 9.
    Build System ... repo travis git push hook tasks
  • 10.
    Build System ... repo travis git push hook task tasks
  • 11.
    Build System ... git clone repo travis git push hook task tasks
  • 12.
    Build System ... git clone repo status travis git push hook task tasks
  • 13.
    Build System ... git clone repo status travis git push hook task tasks
  • 14.
    Build System ... git clone repo status travis git push hook task tasks updates
  • 15.
    Open Source Community • Travis CI is free to use for any public GitHub project • Travis is great for any Ruby project
  • 16.
    But Can AlsoBuild ... clojure
  • 17.
    Getting Started ... 1.Sign up with Travis CI using your GitHub account 2. Enable the repositories that you want Travis to build
  • 19.
  • 20.
    A Travis WorkerBuilds Your Project... $ rvm use 1.8.7 $ git clone git://github.com/YOUR/PROJECT.git $ bundle install --path vendor/bundle $ bundle exec rake
  • 23.
    Announce Your Build Status! • Status Images • E-mail Notifications • IRC Notifications
  • 24.
  • 25.
    Build Matrix ... •Defined by your .travis.yml • Configure ... • Ruby versions (rvm) • Custom Gemfiles • Environment Variables • Script to run
  • 26.
    Jsonify .travis.yml rvm:   - 1.9.3   -1.9.2   - 1.8.7   - jruby   - rbx-2.0 env:   - RAILS_VERSION='~>3.0.0'   - RAILS_VERSION='>=3.1.0'
  • 27.
    Jsonify .travis.yml 10 rvm:   - 1.9.3   - 1.9.2 Builds   - 1.8.7   - jruby   - rbx-2.0 env:   - RAILS_VERSION='~>3.0.0'   - RAILS_VERSION='>=3.1.0'
  • 28.
    But Wait ... There’s More! • before / after scripts • matrix exclusion matrix: { exclusion: [{ rvm: 1.8.7, env:RG=1.3.6 }]} • specify branches to build (white/blacklist) # blacklist branches: except: - legacy - experimental
  • 29.
    Built-in DB Support SQLite3 MySQL PostgreSQL MongoDB All Available with no extra setup required
  • 30.
  • 31.
    What about ?? ? Redis sphinx memcached CouchDB python OpenJDK ImageMagick Selenium Riak
  • 32.
    Vanity .travis.yml rvm: -1.8.7 - 1.9.2 gemfile: - Gemfile env: - DB=mongodb - DB=redis - DB=mysql before_script: - "mysql -e 'create database vanity_test;' >/dev/null"
  • 34.
  • 35.
    The “Hosh” Factor Whatmetrics do you use when evaluating gems and applications?
  • 36.
    The “Hosh” Factor Whatmetrics do you use when evaluating gems and applications? • GitHub watchers and forks • RubyGems.org download count • Recent commit activity • Travis Build Status and History
  • 37.
    In the works... • RabbitMQ replacing Resque • SproutCore replacing Backbone.js • Travis API • Private Repos* Sven’s Mantra “Do the simplest thing possible then Improve”
  • 38.
    Interesting Svenisms ... • simple_states • data_migrations • hashr
  • 39.
    Get Involved ... 1.put your apps on Travis 2. about.travis-ci.org 3. #travis on freenode
  • 40.
  • 41.
  • 42.

Editor's Notes

  • #2 \n
  • #3 What is CI? It’s just not for teams. Integration can mean external services and platforms and runtimes.\n
  • #4 \n
  • #5 Sven Fuchs - i18n, Globalize3, ... \n
  • #6 Widespread distribution is still WIP\n
  • #7 Message Que originally Resque; migrating to Rabbit MQ (AMQP)\nBrowser app is currently Backbone.js; migrating to SproutCore\n
  • #8 Message Que originally Resque; migrating to Rabbit MQ (AMQP)\nBrowser app is currently Backbone.js; migrating to SproutCore\n
  • #9 Message Que originally Resque; migrating to Rabbit MQ (AMQP)\nBrowser app is currently Backbone.js; migrating to SproutCore\n
  • #10 Message Que originally Resque; migrating to Rabbit MQ (AMQP)\nBrowser app is currently Backbone.js; migrating to SproutCore\n
  • #11 Message Que originally Resque; migrating to Rabbit MQ (AMQP)\nBrowser app is currently Backbone.js; migrating to SproutCore\n
  • #12 Message Que originally Resque; migrating to Rabbit MQ (AMQP)\nBrowser app is currently Backbone.js; migrating to SproutCore\n
  • #13 Message Que originally Resque; migrating to Rabbit MQ (AMQP)\nBrowser app is currently Backbone.js; migrating to SproutCore\n
  • #14 Message Que originally Resque; migrating to Rabbit MQ (AMQP)\nBrowser app is currently Backbone.js; migrating to SproutCore\n
  • #15 Rails / RubyGems / Sinatra etc.\n
  • #16 Clojure / Erlang / NodeJS / Scala\n
  • #17 \n
  • #18 Organization Repositories are supported ... you just have to enable the service hook from GitHub\nWHAT NEXT?!\n
  • #19 \n
  • #20 Default build sequence w/o custom config\n
  • #21 \n
  • #22 \n
  • #23 Campfire is in progress\n
  • #24 \n
  • #25 \n
  • #26 \n
  • #27 \n
  • #28 \n
  • #29 No practical limitations; defined by Travis Worker Chef Cookbooks\n
  • #30 No practical limitations; defined by Travis Worker Chef Cookbooks\n
  • #31 No practical limitations; defined by Travis Worker Chef Cookbooks\n
  • #32 No practical limitations; defined by Travis Worker Chef Cookbooks\n
  • #33 No practical limitations; defined by Travis Worker Chef Cookbooks\n
  • #34 No practical limitations; defined by Travis Worker Chef Cookbooks\n
  • #35 No practical limitations; defined by Travis Worker Chef Cookbooks\n
  • #36 No practical limitations; defined by Travis Worker Chef Cookbooks\n
  • #37 No practical limitations; defined by Travis Worker Chef Cookbooks\n
  • #38 \n
  • #39 \n
  • #40 \n
  • #41 \n
  • #42 First 3 items are actively being worked on\nPrivate repo support is obvious enhancement; but focus is on community support at this point\n
  • #43 simple_states: a state machine (akin to state_machine and aasm)\ndata_migrations: DSL for Rails migrations with data changes (e.g. in prod environments)\nhashr: makes working with nested hashes easier\n
  • #44 \n
  • #45 \n
  • #46 \n
  • #47 I like to think of this Travis ... getting in your face when your app won’t build!\n