rodrigobertin
1/27/2017 - 10:02 PM

ftpSubida.js

var DiffDeployer = require('ftp-diff-deployer'),
    config       = require('./config.json');

var host = {
    ftp:config.servidor.host,
    user:config.servidor.user,
    pass:config.servidor.pass,
    remote:config.servidor.remote,
    localfolder:config.servidor.localFolder,
    exclude:config.exclude
};

var deployer = new DiffDeployer({
    host:host.ftp,
    auth:{
        username:host.user,
        password:host.pass
    },
    src:host.localfolder,
    dest:host.remote,
    exclude:host.exclude,
    memory:'ftp-diff.json'
});

//subir al server
deployer.deploy(function (err) {
    if (err) {
        console.error('Something went wrong!');
        console.error(err);
    } else {
        console.log('Archivos subidos!');
    }
});