Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use ssh keys other than the default? #53

Open
ddoddsr opened this issue Jul 6, 2018 · 1 comment
Open

Is it possible to use ssh keys other than the default? #53

ddoddsr opened this issue Jul 6, 2018 · 1 comment

Comments

@ddoddsr
Copy link

ddoddsr commented Jul 6, 2018

I can rsync (using the same key I use to ssh), like this from the command line:
rsync -r -a -v -e "ssh -i ~/.ssh/my-key-local-dev" & etc

How would I add the path to my public key to gulp-rsync config option?

@sangtcao
Copy link

Just recently came into this issue and managed to put it together. Since no one else on the web posted a solution, figured I'd do my duty here and pass it along. Hope it can still be useful to others:

gulp-rsync doesn't support this by default, but back in 2015 there was an added feature for any custom options when running the command (#17). You can attach the -e option to your shell command like so:

var gulp = require('gulp');
var rsync = require('gulp-rsync');

gulp.task('deploy', function() {
  gulp.src('build/**')
    .pipe(rsync({
      username: 'user',
      hostname: 'host',
      destination: '~/',

      options: {
        "e": "ssh -i <local-path-to-key-file>"
      }

    }));
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants