Gulp remote deploy timeout

时间:2019-01-07 13:16:41

标签: java deployment ftp gulp vinyl-ftp

Im trying to upload html files to a remote server with a gulp task. Im using Vinyl-fpt for this.

// Deploy email html to remote server
gulp.task( 'remote-deploy',function(){
    var conn = getFtpConnection();
    return gulp.src(localFiles, {base: '.', buffer: false})
        .pipe(conn.newer(remoteLocation))
        .pipe(conn.dest(remoteLocation))
});


var localFiles = [
    './dist/',
];

var remoteLocation = '/home/email/htdocs/content/2019/business/shit';

function getFtpConnection(){
    return vinylFTP.create({
        host: 'host',
        port: 22,
        user: 'user',
        password: 'password',
        parallel: 5,
        log: gulpUtils.log
    })
}

whenever i try to deploy it gets stuck on "CONN"

[15:12:58] Using gulpfile ~\PhpstormProjects\eMails\emails\gulpfile.js
[15:12:58] Starting 'remote-deploy'...
[15:12:58] CONN 

i have tried other ftp plugins but get the same results mostly, the credentials are correct and i can connect with a client. I have googeled a bunch and found many people with the same question but no definitive answer. The servers ftp is passive and i dont know what to do anymore.

If anyone has any suggestions then they would be greatly apreciated.

1 个答案:

答案 0 :(得分:0)

找出问题所在。连接超时,因为服务器是SFTP而不是FTP,这很愚蠢,因为您认为它会抛出错误,但是是的。