簡體   English   中英

來自Windows客戶端的grunt-rsync失敗

[英]grunt-rsync from Windows client fails

我想使用Grunt和rsync將一些代碼從我的計算機(Windows)部署到服務器(Linux)。

我的Gruntfile.js

module.exports = function(grunt) {

    grunt.initConfig({

        rsync: {
            options: {
                args: ['--verbose', '--chmod=777'],
                exclude: ['*.git', 'node_modules'],
                recursive: true
            },
            production: {
                options: {
                    src: './bitzl.com',
                    dest: '/home/marcus/bitzl.com',
                    host: 'marcus@bitzl.com',
                    syncDest: true
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-rsync');
}

請注意,我使用marcuschmod=777只是為了簡化測試。

運行grunt rsync失敗:

Running "rsync:production" (rsync) task
rsyncing ./example.com >>> /home/marcus/bitzl.com
Shell command was: rsync ./bitzl.com marcus@bitzl.com:/home/marcus/bitzl.com --rsh ssh --recursive --delete --delete-exc
luded --exclude=*.git --exclude=node_modules --verbose --chmod=777
ERROR
Error: rsync exited with code 12
Warning: Task "rsync:production" failed. Use --force to continue.
Error: Task "rsync:production" failed.
    at Task.<anonymous> (D:\git\bitzl.com\node_modules\grunt\lib\util\task.js:200:15)
    at null._onTimeout (D:\git\bitzl.com\node_modules\grunt\lib\util\task.js:236:33)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

Aborted due to warnings.

但是,在沒有Grunt的情況下從上面運行rsync命令可以正常工作:

rsync ./bitzl.com marcus@bitzl.com:/home/marcus/bitzl.com --rsh ssh --recursive --delete --delete-excluded --exclude=*.git --exclude=node_modules --verbose --chmod=777

Rsync承諾我的公鑰的密碼(通過Grunt它沒有)和同步就像一件輕而易舉的事。

服務器上的身份驗證通過公鑰(帶密碼)進行。 密碼驗證也沒問題。

我的猜測是,密碼promt以某種方式中斷,rsync因協議錯誤而失敗(即退出代碼12 )。

我缺少什么讓grunt-rsync在Windows上工作?

更新:

從Linux VM(Ubuntu 12.04到Virtualbox / Vagrant),它可以像預期的那樣工作。

原來這是grunt-rsync中的一個錯誤。 我已經接受了為rsyncwrapper填寫的pull請求,並且使用最新版本的grunt-rsync,一切都按預期工作。

如果仍然遇到問題,請確保至少安裝了grunt-rsync版本0.6.0。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM