Speed up Travis CI builds by caching the bundle to S3
When we run our build suites on Travis Pro the bundling step takes the most time by a wide margin (aside from the test script itself).
Inspired by this Coderwall protip by Michał Czyż, I set about attempting to cache our completed gem bundle on S3.
How it works
- The tarballed bundle and a SHA-2 sum of the
Gemfile.lock
are downloaded from S3 (if they exist) - Travis runs
bundle install
as normal (except that the bundle is installed to~/.bundle
). This shouldn't take more than a few seconds if the bundle hasn't changed. - Travis executes all the normal build steps, as usual
- The bundle is tarballed and uploaded to S3 (us-east is the closest region to the new Travis workers), but only if the SHA-2 hash for the
Gemfile.lock
has changed
Step by step instructions
Read more on my blog… (I didn't want to repost the entire blog post here)
Written by Matias Korhonen
Related protips
2 Responses
Link doesn't work 😢
over 1 year ago
·
Seems to be a Coderwall bug, I sent a message to their support address. Hopefully they'll fix it soon, but here's the address again: http://randomerrata.com/post/45827813818/travis-s3
Though Travis Pro has built-in caching now, so most of this isn't required anymore: https://docs.travis-ci.com/user/caching/
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#