CircleCI gems caching

孤街浪徒 提交于 2019-12-01 05:06:53

The solution is simple: CircleCI runs some commands by default and caches gems also by default in vendor/bundle, so there is no need to add anything to cache_directories.

Among those default commands is bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3, that checks presence of gems in the cache directory and installs them if they are not there.

In my case I had project consisting of multiple applications (main application, common UI, API client and API mock) split into 4 different repos. Most of them needed bundle install commands.

The only thing I had to do is to replace all my bundle install commands (that always installs gems) with bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3. In such case all gems are installed only the first time I run tests and all the following builds use previously cached gems.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!