Advertisement
Guest User

Untitled

a guest
Jan 26th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. var gulp = require('gulp');
  2. var GulpSSH = require('gulp-ssh');
  3.  
  4. var config = {
  5. host: '...',
  6. port: 22,
  7. username: '...',
  8. password: '...'
  9. };
  10.  
  11. var gulpSSH = new GulpSSH({
  12. ignoreErrors: false,
  13. sshConfig: config
  14. });
  15.  
  16. gulp.task('upload', function () {
  17. return gulp.src(['file.zip'])
  18. .pipe(gulpSSH.sftp('write', 'test/file.zip'))
  19. });
  20.  
  21. gulp.task('unzip', function () {
  22. return gulpSSH.exec("cd test && unzip file.zip");
  23. });
  24.  
  25. cd test && -xvf file.tar
  26.  
  27. [16:17:55] Starting 'unzip'...
  28. [16:17:57] gulp-ssh :: Executing :: cd test && -xvf file.tar
  29. [16:17:58] Finished 'unzip' after 2.68 s
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement