2

The new docker-based build environment supports bundler caching on open source projects.

I'm trying to enable it in a pull request but it fails.

I don't know if it can be used when using a build matrix with multiple Gemfiles:

gemfile:
   - spec/gemfiles/Gemfile.rails-3.2.x
   - spec/gemfiles/Gemfile.rails-4.0.x
   - spec/gemfiles/Gemfile.rails-4.1.x
   - spec/gemfiles/Gemfile.rails-4.2.x

Has anyone got this working and can share their .travis.yml?

Gerard Roche
  • 6,162
  • 4
  • 43
  • 69
nathany
  • 539
  • 5
  • 16
  • I'm unable to make caching work as well.. (bundler/ruby). I wonder if that's just a problem of documentation. – m1keil Jan 14 '15 at 10:37

1 Answers1

1

Arbitrary directories can be cached.

Arbitrary directores

You can cache arbitrary directories, such as Gradle, Maven, Composer and npm cache directories, between builds by listing them in your .travis.yml:

cache:
  directories:
  - .autoconf
  - $HOME/.m2

Travis CI Documentation

I don't know where gemfiles are cached, but say it's ~/.gem/specs:

 cache:
   directories:
   - $HOME/.gem/specs

The Travis CI build log will print something along the lines of:

Setting up build cache

$ export CASHER_DIR=$HOME/.casher

$ Installing caching utilities                        0.05s
                                                      0.00s
attempting to download cache archive                  0.47s
fetching master/cache-linux-precise-xxx-xxx-xxx.tgz
found cache
                                                      0.00s
adding /home/travis/.gem/specs                        1.28s
Gerard Roche
  • 6,162
  • 4
  • 43
  • 69