fis3-deploy-http-push icon indicating copy to clipboard operation
fis3-deploy-http-push copied to clipboard

可否增加 增量发布的功能

Open monkee opened this issue 10 years ago • 1 comments

在发布的过程中,远程发布并不一定是内网环境,因此批量发布的过程中,全量发布有如下问题:

  1. 文件数多,时间很长
  2. 发布过程中可能出现的网络抖动、异常等造成发布失败,又得重新发布(里面有重试机制,默认是2,调整这个会增加发布时间)

因此,可否增加一个 增量发布?已经发布过的,如果没有变化,可以不上传呢?

monkee avatar Aug 05 '15 00:08 monkee

目前watch模式已经是增量发布了。

如果你想做到走缓存的文件跳过上传的话,完全可以在插件外实现。如:

fis.match('*', {
  deploy: [

    function(options, modified, total, next) {
      // 对 modified 进行修改,过滤。

      var i = modified.length - 1;
      var file;

      while ((file = modified[i--])) {
        if (file._fromCache) {
          modified.splice(i + 1, 1);
        }
      }

      next();
    }
    fis.plugin('http-push', {
       // ...
    })
  ]
})

2betop avatar Jun 08 '16 03:06 2betop