Background
I'm using multiple Gemfiles in one travis run, e.g. ./Gemfile, ./folder_a/Gemfile and ./folder_b/Gemfile. To improve the speed of one run, caching for bundle install is advised. Using directory caching (see http://docs.travis-ci.com/user/caching/#With-a-custom-install-step ) this is already possible.
Limits to this approach
Sadly right before uploading the cache (store build cache), a bundle clean is executed. This means, that all gems, which are not listed in ./Gemfile are removed from the bundle cache. So all gems from ./folder_a/Gemfile and ./folder_b/Gemfile which are not in ./Gemfile are removed. This also implies, that all Gems from folder_a and folder_b need to be installed on every travis run, thus defeating the purpose of a cache.
Workaround
It's possible to use two different bundle cache folders. One for ./Gemfile and the other for all the other Gemfiles. This implies, that whenever something is called from folder_a or folder_b an additional ENV variable needs to be set.
This is cumbersome and error prune, since forgetting to set the correct ENV:
- installing gems to the wrong cache and therefore being removed from the cache, once
bundle clean will run
- or
bundle exec can not be executed, because the gems where installed into another cache folder.
Wish
Please provide a way to disable bundle clean during store build cache. This would allow me to use multiple Gemfiles, while using one cache folder.
I understand, that bundle clean is there for a reason, to ensure, that the cache will not contain unneeded or obsolete files. But it's in our (the customers) interest to keep the cache folder small to improve the speed of a travis run. So a manual travis cache --delete once in awhile would be enough.
Background
I'm using multiple Gemfiles in one travis run, e.g.
./Gemfile,./folder_a/Gemfileand./folder_b/Gemfile. To improve the speed of one run, caching for bundle install is advised. Using directory caching (see http://docs.travis-ci.com/user/caching/#With-a-custom-install-step ) this is already possible.Limits to this approach
Sadly right before uploading the cache (
store build cache), abundle cleanis executed. This means, that all gems, which are not listed in./Gemfileare removed from the bundle cache. So all gems from./folder_a/Gemfileand./folder_b/Gemfilewhich are not in./Gemfileare removed. This also implies, that all Gems fromfolder_aandfolder_bneed to be installed on every travis run, thus defeating the purpose of a cache.Workaround
It's possible to use two different bundle cache folders. One for
./Gemfileand the other for all the other Gemfiles. This implies, that whenever something is called fromfolder_aorfolder_ban additionalENVvariable needs to be set.This is cumbersome and error prune, since forgetting to set the correct
ENV:bundle cleanwill runbundle execcan not be executed, because the gems where installed into another cache folder.Wish
Please provide a way to disable
bundle cleanduringstore build cache. This would allow me to use multiple Gemfiles, while using one cache folder.I understand, that
bundle cleanis there for a reason, to ensure, that the cache will not contain unneeded or obsolete files. But it's in our (the customers) interest to keep the cache folder small to improve the speed of a travis run. So a manualtravis cache --deleteonce in awhile would be enough.