I've been using gulp-rsync for deploying static assets to my server via gulp task. And I use incremental option to determine whether a file needs to be updated or not. This works fine :)
I need save the progress displayed in the console in a file or whatever.. Because i need purge individual files in the cache on cloudflare :/
Looks like that (in the console):
[20:49:52] Starting 'rsync'...
[20:49:53] gulp-rsync: Starting rsync to my-ssh-hostname:/example/public-html/assets/...
[20:49:55] gulp-rsync: sending incremental file list
[20:49:57] gulp-rsync: favicon.ico
[20:49:57] gulp-rsync: 1150 100% 439.45kB/s 0:00:00 (xfer#1, to-check=12/13)
[20:49:57] gulp-rsync: css/main.css
[20:49:57] gulp-rsync: 2712 100% 101.86kB/s 0:00:00 (xfer#2, to-check=11/13)
[20:49:57] gulp-rsync: css/style.css
[20:49:57] gulp-rsync: 1445 100% 54.27kB/s 0:00:00 (xfer#3, to-check=9/13)
[20:49:57] gulp-rsync: js/app.js
[20:49:57] gulp-rsync: 31878 100% 1.09MB/s 0:00:00 (xfer#7, to-check=3/13)
[20:49:57] gulp-rsync: scripts.js
[20:50:01] gulp-rsync: 76988 100% 2.53MB/s 0:00:00 (xfer#9, to-check=1/13)
[20:50:01] gulp-rsync: sent 2401 bytes received 2820 bytes 10442.00 bytes/sec
[20:50:02] gulp-rsync: total size is 10106 speedup is 4.37
[20:50:02] gulp-rsync: Finished 'rsync' after 3.38 s
I need save and extract the files in log:
favicon.ico,
css/main.css,
css/style.css,
js/app.js,
scripts.js
-- My original "gulpfile.js" :
var
gulp = require('gulp'),
gutil = require('gulp-util'),
rsync = require('gulp-rsync'),
logCapture = require('gulp-log-capture');
var config = {
hostname : 'my-ssh-hostname',
destination : '/example/public-html/assets/',
progress: true,
incremental: true,
relative: true,
emptyDirectories: true,
recursive: true,
clean: true,
exclude: ['._', '.DS_Store' , 'thumbs.db', 'desktop.ini'],
chmod: '775',
};
gulp.task('rsync', function (){
return gulp.src('./my-local-dir/' + '**/*')
.pipe(rsync(config))
});
-- I found the "Log Capture Plugin for Gulp" - gulp-log-capture
What's the right way to use? :/
gulp.task('rsync', function (){
return gulp.src('./my-local-dir/' + '**/*')
.pipe(logCapture.start(process.stdout, 'write'))
.pipe(rsync(config))
.pipe(logCapture.stop('txt'))
.pipe(gulp.dest('./dest'));
});
Any sugestions will be apreciated :)