Skip to content

增加缓存Cache 能力 #45

Description

@heimanba

全局缓存

作为项目级别存储:
image
实际存储NAS路径 为: /mnt/auto/cache

项目级别缓存

  • 自定义模式
cache:
    paths: 
	- ./node-modules
    	- ./public
    key: npm-${{ hashFiles('package-lock.json') }}

问题1: 如何存储数据
./node-modules./public 分别存入 /mnt/auto/${appName}/${key} 文件下
问题2: 什么时机进行数据存储
识别如果是 cache的步骤, onComplete 添加默认 存储的步骤
问题3: 缓存什么时候生效
默认在onInit 阶段生效
问题4: 缓存如何生效?
默认以软链形式进行生效,格式为 ln -s /mnt/auto/${appName}/${key}/node-modules node-modules
问题5: 软链冲突如何解决?
假设已经存在了 node_modules,如何处理冲突?

  • 简单模式
cache:
  npm: true 

等于=>

cache:
    paths: 
	- ./node-modules
     key: npm-${{ hashFiles('package-lock.json') }}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions