-
-
Save sandman81/92e8ad5789b2096d3252c7ec917be036 to your computer and use it in GitHub Desktop.
Gulp Rsync
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var rsync = require('gulp-rsync'); | |
gulp.task('deploy', function(){ | |
// Dirs and Files to sync | |
rsyncPaths = ['rsynctest01' ]; | |
// Default options for rsync | |
rsyncConf = { | |
verbose: true, | |
incremental: true, | |
relative: true, | |
emptyDirectories: true, | |
recursive: true, | |
clean: true, | |
exclude: ['node_modules', '.svn', '.git'], | |
hostname: '', // hostname | |
username: '', // ssh username | |
destination: 'rsynctest02', // path where uploaded files go | |
}; | |
// Use gulp-rsync to sync the files | |
return gulp.src(rsyncPaths) | |
.pipe(rsync(rsyncConf)); | |
}); | |
gulp.task('watch', function(){ | |
gulp.watch('rsynctest01/**/*', ['deploy']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment