Open ddoddsr opened 6 years ago
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 (https://github.com/jerrysu/gulp-rsync/issues/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>"
}
}));
});
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?