Jeremy Durham

Ruby, Rails, and everything in between.

  • BlogThoughts
  • AboutAbout the Author
  • ContactGet in touch

December 19, 2009 20:43
Posted by Jeremy Durham

Rails, Integrity, Bundler and lots of builds

I’ve been using bundler happily for the last month or so, and if you haven’t already checked it out, there’s numerous other sources that can explain it better than I can. Go check them out. Today I want to focus on CI and what having 60 megs of bundled code can mean for your builds.

Each of our builds are about 70 meg, 60 megs for the bundled code, a few megs in logs and a few megs in code. We generally push about 10-15 times per day. Right now we have 3 main projects going on. Even though I forked Integrity to only keep builds for a limited time, which in our case is 14 days, one app could still use as much as 10 gigs of space to store 14 days of builds. When you consider that we have three apps, with several more starting soon, these numbers were starting to look really scary.

We worked out a simple solution that seems to solve our problem, and actually speed up our builds. We set an environment variable, right now called CI, which specifies where the bundled gems lives. When we do a bundle, we do: CI=/path/to/bundled/gems gem bundle && rake integrity:all.

We modified both our Gemfile and preinitializer as follows:

Gemfile:

bundle_path ENV['CI'] ? ENV['CI'] : 'vendor/bundled_gems'

And preinitializer:

bundle_path = ENV['CI'] ? ENV['CI'] ? 'vendor/bundled_gems'
require "#{File.dirname(__FILE__)}/../#{bundle_path}/environment"

This allows developers on their local machine to just do a normal “gem bundle” to run the app, but gives us flexibility on the build machine to point at a relative path where the bundled gems will live, outside of the application. That means the bundled gems just get updated, instead of getting pulled each time.

How are you managing bundled gems and Continuous Integration? What do you do with your gigs worth of old builds?

No Comments

Posted Under Programming

  • Posts
  • Twitter
  • Flickr
 

There is no Holy ...

Technology

 

Google and Apple:...

Technology

 

Setting up Git an...

Technology

@mariusrugan awesome, glad I was able to be of some help

follow me on
twitter

125942640_a3dcc3f951_s125942637_c4524c7c88_s125942628_a682f8a639_s122144184_5f2dd86929_s122144182_1b01ded312_s122144181_893a82f1d3_s122144179_70465b00ff_s122102402_21e6174af6_s122102401_f6d9ebff55_s

Categories

  • Technology
  • Programming
  • Family
  • Travel

This site is using the Handgloves WordPress Theme
Designed & Developed by George Wiscombe

Subscribe via RSS