Open bian17888 opened 8 years ago
应该是这里错了 gulpSSH.dest('/dist')
, 你没有该根目录的权限 /dist
i have this same error seems plugin isn't working
gulp.task("sendFile",["build"], _ => {
return gulp.src("../stats_x86_64")
.pipe(ssh.dest("/home/nikos/"));
})
gulp.task("deploy", ["sendFile"], _ => {
return ssh.exec(["chmod a+x /home/nikos/stats_x86*","exit"]).pipe(gulp.dest("logs"))
})
here is my code
gulp.src("../stats_x86_64/**/*")
@zensh stats_x86_64 is an executable not a folder
@NikosEfthias You should remove _
from =>
function
it tells function will not have any parameters in es6 syntax what it has to do with ssh ?
I get the same error too
[14:50:36] 'deploy' errored after 4.35 s
[14:50:36] Error in plugin 'gulp-ssh'
Message:
Failure
Details:
code: 4
lang:
My code,
gulp.task("deploy", function() {
if(webDeployConfig.enabled)
{
var gulpSSH = new GulpSSH({
ignoreErrors: true,
sshConfig: {
host: webDeployConfig.webserver,
port: webDeployConfig.port,
username: webDeployConfig.username,
password: webDeployConfig.password
}
});
return gulp.src(['target/**/*.*', '!target/**/*.ts', '!target/**/*.map'])
.pipe(gulpSSH.dest(webDeployConfig.uploadDirectoryPath));
}
else
{
console.log("deploy is disabled!");
}
});
events.js:141
throw er; // Unhandled 'error' event
^
Error: Failure
at SFTPStream._transform (F:\gulp-ssh\node_modules\ssh2\node_modules\ssh2-streams\lib\sftp.js:384:27)
at SFTPStream.Transform._read (_stream_transform.js:167:10)
at SFTPStream._read (F:\node_modules\gulp-ssh\node_modules\ssh2\node_modules\ssh2-streams\lib\sftp.js:170:15)
at SFTPStream.Transform._write (_stream_transform.js:155:12)
at doWrite (_stream_writable.js:300:12)
at writeOrBuffer (_stream_writable.js:286:5)
at SFTPStream.Writable.write (_stream_writable.js:214:11)
at Channel.ondata (_stream_readable.js:542:20)
at emitOne (events.js:77:13)
at Channel.emit (events.js:169:7)
@goldenratio theres no support for this plugin i guess i just used rsync with child_process.exec in my gulpfile if you are on a mac or linux machine you can also do the same thing i am not sure about mac but on linux rsync comes pre-installed
It seems the issue happens if I upload over 100 files or so.
@goldenratio i tried to upload just a single binary about 30 mbytes
could be related to this, https://github.com/mscdex/ssh2-streams/issues/32 @zensh has to update plugin's dependencies
@goldenratio ssh2 should update it's dependencies~ https://github.com/mscdex/ssh2/blob/master/package.json#L8
@zensh created issue ticket https://github.com/mscdex/ssh2/issues/448
Are there any updates regarding this? Seems like it's still not working with a large number of files.
Are there any updates regarding this? Seems like it's still not working with a large number of files.
Same issue here. Any solutions or workarounds anyone?
I had to keep using gulp-ssh
as the most effective solution for my deploy as I would not like to switch from Windows to linux or to pollute my machine with WSL for just one project, neither could I use the normal CI/CD instruments (e.g. Github Actions) due to the project in part comprises a heavy legacy codebase not suited for deploying from SVN.
So I had to find a workaround. That took some fresh thinking.
Here is it all from my Gulp deploy task:
Zip the built in advance code on my local dev machine with gulp-zip;
Upload the ziped code to a server with pscps
utility from PuTTY package being run as a Windows CLI command using Node child_process.spawn
.
Of course I had to construct the PSCP command that sounded like that:
pscp -r -i z:path\to\my\key\file\server.ppk "..\built\code\folder\zipped-deploy-version.zip" user@web-server-domain-or-ip.tld:/var/www/myproject/deploy/folder
;
And then unzip it there with gulp-ssh exec executing somethng like cd /var/www/myproject/deploy/folder && unizip -o zipped-deploy-version.zip
.
Hope that helps someone.
when I copied the files to remote server , I received the error messages ....
how can I solve this problem~ thx
===== gulp code ===== gulp.task('deploy:copy', ['deploy:clean'], function () { return gulp .src([conf.paths.dist + '/**']) .pipe(gulpSSH.dest('/dist'));
===== error info ===== [17:43:31] Error in plugin 'gulp-ssh' Message: Failure Details: code: 4 lang: