Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可否增加 增量发布的功能 #1

Open
monkee opened this issue Aug 5, 2015 · 1 comment
Open

可否增加 增量发布的功能 #1

monkee opened this issue Aug 5, 2015 · 1 comment

Comments

@monkee
Copy link

monkee commented Aug 5, 2015

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

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

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

@2betop
Copy link
Contributor

2betop commented Jun 8, 2016

目前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', {
       // ...
    })
  ]
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants