Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Debugging Travis builds

Ben Moss
Sunday, October 7, 2012

(Due credit to Trung LĂȘ‘s article on which all this is based)

We recently moved our project’s CI from a TeamCity server onto Travis CI’s new private CI-as-a-service program. We compared several other hosted CI services and found Travis to be the easiest to use, and with the help of Trung’s article also the easiest to debug.

Travis provides all their build worker images as Vagrant boxes available for download. I’d never worked with Vagrant before, but getting it set up is pretty simple. Follow the guide on Vagrant’s page and download the latest version of Vagrant. I’ve found that the boxes that Travis provide right now don’t work with VirtualBox 4.2, and so I’d recommend installing VirtualBox with 4.1 from their ‘older builds’ page.

Once you’re done installing both, you’ll want to install the worker box. The Ruby box is installable via

vagrant box add travis-ruby http://files.travis-ci.org/boxes/provisioned/travis-ruby.box

This will download and install the VM, which will probably take a few minutes. After that’s complete, initialize the box with

vagrant init travis-ruby

which will create a Vagrantfile for you where you can configure various settings for how Vagrant hosts the VM on your machine. I’ve found it necessary to add

config.ssh.username = "travis"

to get SSH to work properly. After that,

vagrant up
vagrant ssh

will connect you to the box, and verify that things are working properly. If you are prompted for a password upon sshing, it should be travis.

Now you’ll want to either scp your Github SSH key or create a new one and clone your project down to the box. After you have your project, all that remains is to get Travis running.

I haven’t yet figured out how Travis starts from .travis.yml files, so for now we have just created a shell script in which we specify all our Travis setup tasks, put it as the ‘script’ key in our .travis.yml, and then just run it directly on our local box. You can find more info about doing this on the Travis docs page. Aside from working around the .travis.yml, we haven’t seen any other gotchas in simulating the Travis worker process.

Once you’ve successfully gotten your build to run inside the Vagrant box, you can follow the instructions on Vagrant’s site to repackage your customized Travis worker and share it with the rest of your team.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

One comment

  1. Travis Grathwell says:

    I think Travis changed the architecture of their boxes from 32 to 64 bit but the travis-ruby.box file hasn’t been updated accordingly.

    This bit me when I tried to install the 32-bit version of PhantomJS 1.8.2 in the before_script phase, which worked in the VM but failed on actual-Travis.

    I’m sure there’s an updated .box file out there somewhere, but Travis makes it hard to determine how these boxes are built without digging deep into every one of their Github projects.

    March 17, 2013 at 7:57 pm

Add New Comment Cancel reply

Your email address will not be published.

Ben Moss

Ben Moss
New York

Recent Posts

  • Means, Ends, Mocks, Stubs
  • Running JSHint from within Jasmine
Subscribe to Ben's Feed

Author Topics

ci (1)
travis-ci (1)
javascript (1)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >