Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Travis CI cache: ignore specific folder/file from cache

I have the following configuration in my .travis.yml:

language: node_js
node_js:
- '5.0.0'
sudo: false
cache:
  bundler: true
  directories:
  - node_modules

One of my packages is a Github branch where content changes but version remains unchanged. What happens is that the cache is not invalidated, and there is nothing wrong at this point. But I wonder if there is a way to exclude a specific folder from the cache construction, something along these lines:

language: node_js
node_js:
- '5.0.0'
sudo: false
cache:
  bundler: true
  directories:
  - node_modules
  - !node_modules/grommet

Where !node_modules/grommet will be excluded from the cache index.

I tried using before_cache as described in here. But no luck.

Any help appreciated...

like image 776
Alan Souza Avatar asked Nov 06 '15 17:11

Alan Souza


1 Answers

I had to reinstall the module manually. In your case, your travis.yml install section should look like this:

install:
  - npm uninstall grommet
  - npm install
like image 123
Daniel Nguyen Avatar answered Nov 15 '22 21:11

Daniel Nguyen