2017-08-13 47 views
0

我在一个项目中有多个文件夹,每个文件夹都有自己的yarn.lock。当在Gitlab亚军运行,通过纱线安装所有节点模块正在即使我使用yarn config set cache-folder很长一段时间:加速Gitlab Runner上的多个纱线安装

yarn config set cache-folder .yarn-cache 

# For each folder with a yarn.lock file: 
yarn install \ 
    --no-progress \ 
    --pure-lockfile \ 
    --ignore-platform 

然后我.gitlab.yml文件有以下:

cache: 
    paths: 
    - .yarn-cache 
    - node_modules 

我我试图缓存每个文件夹中的每个node_modules文件夹,但有时会花费太长时间来下载并将缓存上载到s3(超过20分钟)并失败。

有没有更合适的为什么要这样做?或者有没有办法加快多次纱线的安装?


注意到它们中的每一个都使用本地文件node_module也是有帮助的。

回答

0

看起来像yarn config set cache-folder .yarn-cache设置缓存文件夹相对于它运行的目录(至少在我使用的纱线版本中)。

我将行更改为yarn config set cache-folder“$(pwd)/。yarn-cache”,这样它就是一个绝对路径,它看起来像缓存现在按预期工作。