Comments (10)
... actually found the solution, had to close the connection properly:
...
.pipe( gulpSsh.dest( config.deployment.toSsh.dest ) )
.on('end', function() { gulpSsh.close(); });
from gulp-ssh.
sorry, I can't understand your code...
from gulp-ssh.
I think I can explain because I have the same problem.
// Read the sftp credentials from the configuration file
var ftpConfig = JSON.parse(fs.readFileSync('./ftp.json', 'utf8'));
// Initialize gulpSSH
var gulpSSH = new plugins.ssh({
sshConfig: {
host: ftpConfig.host,
username: ftpConfig.user,
password: ftpConfig.password
}
});
gulp.task('extract-archive', function () {
return gulpSSH
.exec([
'tar xvzf ' + ftpConfig.dir + 'archive.tar.gz -C ' + ftpConfig.dir
]);
});
Let's run the task:
gulp extract-archive
It works fine, the command is executed on the remote host, I can see: [22:06:01] Finished 'extract-archive' after 1.95 s
in the console, but gulp task never ends. I can only stop it using ctrl + c
.
I tried to call process.exit()
when the end
event is fired:
gulp.task('extract-archive', function () {
return gulpSSH
.exec([
'tar xvzf ' + ftpConfig.dir + 'archive.tar.gz -C ' + ftpConfig.dir
])
.on('end', function () {
process.exit();
})
});
But this causes the following issues:
[22:13:03] Finished 'extract-archive' after 2.07 s
[22:13:04] The following tasks did not complete: extract-archive
[22:13:04] Did you forget to signal async completion?
from gulp-ssh.
You should use options.gulp to tell gulpSSH which gulp instance running
from gulp-ssh.
Still the same. Sorry, I didn't mention that I use gulp v4. Does it make any difference?
var gulp = require('gulp');
var gulpSSH = new plugins.ssh({
sshConfig: {
host: ftpConfig.host,
username: ftpConfig.user,
password: ftpConfig.password
},
gulp: gulp
});
Would you like me to share the whole config?
from gulp-ssh.
I am having the same issue, using also options to pass in the gulp instance:
var gulpSsh = new GulpSsh( {
ignoreErrors: false,
sshConfig: config.deployment.toSsh,
gulp: gulp
} );
...
.pipe( gulpSsh.dest( config.deployment.toSsh.dest ) );
All works fine, but gulp never ends. Also tried (as above to use on('end'
... to finish the task, but also get the same error as above.
Any ideas, did anybody succeed?
from gulp-ssh.
I´m having the same Issue, neither adding the end-Listener nor adding the gulp option helped:
Code:
var gulpSSH = new GulpSSH({
ignoreErrors: false,
"gulp":gulp,
sshConfig: {
"host": "host",
"username": "username",
"port": "22",
"password": "password"
}
});
var sourcePipe = gulp
.src("C:\\myFolder\\mystuff\\**")
.pipe(gulpSSH.dest("/opt/mystuff"))
.on("end",function(){
console.log("called close");
gulpSSH.close();
});
Console log:
C:\myFolder>gulp domyStuff
...
[09:19:36] gulp-ssh :: Ready
[09:19:36] Preparing to write "/opt/mystuff/stuff.txt"
[09:19:36] Writing '/opt/mystuff/stuff.txt'
[09:19:36] Finished writing '/opt/mystuff/stuff.txt'
... nothing happens, the log line "called close" is never printed to console, need to kill the process using Ctrl+c
This is on Windows 7 connecting to a RedHat machine, but also happens on Mac-to-Unix on the same code. NodeJs 2.5.0, gulp-ssh 0.5.4
from gulp-ssh.
Same Issue after updating to gulp-ssh 0.5.6, unfortunately I am not able to update nodejs itself.
from gulp-ssh.
Hi guys:
I have refactored gulp-ssh
, v0.6.0. It works fine for me.
Please try it.
from gulp-ssh.
Thanks. It's works fine.
from gulp-ssh.
Related Issues (20)
- Handshake failed: no matching key exchange algorithm HOT 1
- [Question] How to download folders from server, not just a file?
- ssh ed25519 key
- Alternative to gulp-ssh
- gulpssh.dest: delete remote instead of skipping? HOT 3
- Entering password for `git pull` when using `gulp-shell` HOT 4
- shell(['find logs -type f -mtime +5 -exec rm {} \;']) is not work
- TypeError file.pipe is not a function
- Auto-discover private key HOT 3
- 0.6.1版本有bug,只有文件夹传上去了,文件都没传上去 HOT 5
- Paths broken on Windows HOT 2
- shell commands hang, I can't see errors HOT 4
- sftp write command not create interim directories HOT 4
- gulp-util is deprecated HOT 1
- Don't set cwd / base on virtual file to __dirname
- Add useAgent option to auto-detect running SSH agent
- Allow logging to be tuned HOT 1
- Windows & Pageant (PuTTY) HOT 1
- Very slow HOT 1
- v0.7.1 not on npm?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-ssh.