add new deploy manager to build cmd

This commit is contained in:
Iuri Matias 2017-02-25 20:45:40 -05:00
parent e9ce9dc6f1
commit 85519e95d8
2 changed files with 19 additions and 11 deletions

View File

@ -150,6 +150,7 @@ Cmd.prototype.otherCommands = function() {
.action(function(env){
console.log('unknown command "%s"'.red, env);
console.log("type embark --help to see the available commands");
process.exit(0);
});
};

View File

@ -133,7 +133,6 @@ var Embark = {
callback();
},
function buildPipeline(callback) {
self.logger.setStatus("Building Assets");
var pipeline = new Pipeline({
@ -183,7 +182,6 @@ var Embark = {
callback();
},
function startAssetServer(callback) {
if (!options.runWebserver) {
return callback();
@ -197,14 +195,9 @@ var Embark = {
server.start(callback);
}
], function(err, result) {
if (err) {
self.logger.error(err.message);
} else {
self.logger.setStatus("Ready".green);
self.logger.info("Looking for documentation? you can find it at ".cyan + "http://embark.readthedocs.io/".green.underline);
self.logger.info("Ready".underline);
}
done();
});
@ -213,11 +206,26 @@ var Embark = {
build: function(env) {
var self = this;
async.waterfall([
function displayLoadedPlugins(callback) {
var pluginList = self.plugins.listPlugins();
if (pluginList.length > 0) {
self.logger.info("loaded plugins: " + pluginList.join(", "));
}
callback();
},
function deployAndGenerateABI(callback) {
Embark.deploy(function(abi) {
var deployManager = new DeployManager({
config: Embark.config,
logger: Embark.logger,
plugins: self.plugins,
events: self.events
});
deployManager.deployContracts(function(error, abi) {
callback(null, abi);
});
},
function buildPipeline(abi, callback) {
self.logger.trace("Building Assets");
var pipeline = new Pipeline({
@ -227,11 +235,10 @@ var Embark = {
logger: self.logger,
plugins: self.plugins
});
Embark.events.on('abi', function(abi) {
pipeline.build(abi);
});
pipeline.build(abi);
callback();
}
], function(err, result) {
if (err) {
self.logger.error(err.message);