eden-remote-release
v1.0.3
Published
<h1 align="center">eden-remote-release(A Plug-in for Eden)</h1>
Downloads
3
Readme
Install
npm install eden-remote-release
Example
var glob = require('glob');
var deploy_cfg = require('./deploy-config.js');
var Eden_release = require('eden-remote-release');
var hostName = process.argv[2];
function push(RD, to, modified, callback) {
return Eden_release({
receiver: RD.receiver,
to: RD.root + to
}, modified, function() {
console.log('finish');
});
}
glob(path, function (er, files) {
push(deploy_cfg[hostName], '/', files,);
});
module.exports = {
me: {
receiver: 'http://127.0.0.1:80/receiver.php',
root: 'output'
}
};
You can also use promise
var Q = require('q');
var fs = require('fs');
var glob = require('glob');
var deploy_cfg = require('./deploy-config.js');
var Eden_release = require('../index.js');
var hostName = process.argv[2]; //捕获机器名字
push_config('**/*', '/webroot').then(push_config('**/*.js', '/webroot'));
function push_config(path, to) {
var deferred = new Q.defer();
glob(path, function (er, files) {
push(deploy_cfg[hostName], to, files, deferred);
});
return deferred.promise;
}
function push(RD, to, modified, callback) {
return Eden_release({
receiver: RD.receiver,
to: RD.root + to
}, modified, function() {
callback.resolve()
});
}
Backers
Problems can be submitted to Issues