{"size": 531, "ext": "js", "max_stars_repo_path": "tasks/deploy.js", "max_stars_repo_name": "martinusdev/light-scripts", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "tasks/deploy.js", "max_issues_repo_name": "martinusdev/light-scripts", "max_issues_repo_issues_event_min_datetime": "2020-04-07T12:00:44.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-09T12:37:25.000Z", "max_forks_repo_path": "tasks/deploy.js", "max_forks_repo_name": "martinusdev/light-scripts", "max_forks_repo_forks_event_min_datetime": "2020-11-11T08:19:34.000Z", "max_forks_repo_forks_event_max_datetime": "2020-11-11T08:19:34.000Z"}
{"max_stars_count": null, "max_issues_count": 4, "max_forks_count": 1, "avg_line_length": 23.0869565217, "max_line_length": 59, "alphanum_fraction": 0.6760828625}
const gulp = require('gulp');
const rsync = require('gulp-rsync');
const plumber = require('gulp-plumber');

const { deploy: deployConfig } = require('./../config.js');
const handleError = require('./../utils/handleError.js');

// Deploying via rsync/sftp
// Credentials are stored in .env file

// TODO plumber not working with this
const deployTask = function deploy() {
  const { src, cfg } = deployConfig();

  return gulp.src(src)
    .pipe(plumber(handleError))
    .pipe(rsync(cfg));
};

module.exports = {
  deployTask,
};
