Travis CI缓存:忽略特定文件夹/文件的缓存

7

我在.travis.yml文件中有以下配置:

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

我的一个软件包是 Github 分支,其中内容会变化但版本不变。发生的情况是缓存没有被使无效,并且此时没有任何问题。但我想知道是否有一种方法可以从缓存构建中排除特定文件夹,大致如下:

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

!node_modules/grommet 将被从缓存索引中排除。

我尝试按照这里所述使用before_cache。但没有成功。

感谢任何帮助...

1个回答

2

我不得不手动重新安装模块。在你的情况下,你的travis.ymlinstall部分应该如下所示:

install:
  - npm uninstall grommet
  - npm install

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接