From 4eb079bb7eb08297364031aa39ab0cb4f5afb4cf Mon Sep 17 00:00:00 2001 From: Dion Priyandiono Date: Tue, 13 Dec 2016 16:48:18 +0700 Subject: [PATCH] add rsync task, add config, update package.json --- gulpconfig.js | 9 ++++++++- gulpfile.js/tasks/rsync.js | 16 ++++++++++++++++ package.json | 4 +++- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 gulpfile.js/tasks/rsync.js diff --git a/gulpconfig.js b/gulpconfig.js index 087d560..5c74f83 100644 --- a/gulpconfig.js +++ b/gulpconfig.js @@ -150,5 +150,12 @@ module.exports = { livereload: build+'**/*' }, watcher: 'livereload' // Modify this value to easily switch between BrowserSync ('browsersync') and Livereload ('livereload') - } + }, + + rsync : { + dist: dist, + hostname: '123.456.289.1', + username: 'root', + destination: '/var/www/domain.com/public/wp-content/themes/'+project + }, } diff --git a/gulpfile.js/tasks/rsync.js b/gulpfile.js/tasks/rsync.js new file mode 100644 index 0000000..2f2858f --- /dev/null +++ b/gulpfile.js/tasks/rsync.js @@ -0,0 +1,16 @@ +// ==== RSYNC ==== // + +var gulp = require('gulp'), + config = require('../../gulpconfig').rsync, + rsync = require('gulp-rsync'); + +gulp.task('rsync', function() { + return gulp.src(config.dist + '/**') + .pipe(rsync({ + root: config.dist, + hostname: config.hostname, + username: config.username, + destination: config.destination, + progress: true + })); +}); \ No newline at end of file diff --git a/package.json b/package.json index 2077639..725653f 100644 --- a/package.json +++ b/package.json @@ -32,16 +32,18 @@ "gulp-concat": "^2.6.0", "gulp-cssnano": "^2.1.2", "gulp-imagemin": "^3.0.3", - "gulp-jshint": "^2.0.1", + "gulp-jshint": "^2.0.4", "gulp-livereload": "^3.8.1", "gulp-load-plugins": "^1.2.4", "gulp-rename": "^1.2.2", + "gulp-rsync": "0.0.6", "gulp-ruby-sass": "^2.1.0", "gulp-sass": "^2.3.2", "gulp-sourcemaps": "^1.6.0", "gulp-uglify": "^2.0.0", "gulp-util": "^3.0.7", "html5-history-api": "^4.2.7", + "jshint": "^2.9.4", "merge-stream": "^1.0.0", "normalize.css": "^4.2.0", "require-dir": "^0.3.0",