mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 06:16:01 +00:00
Merge remote-tracking branch 'upstream/develop' into develop
This commit is contained in:
commit
c615b68c28
@ -37,6 +37,15 @@ Engine.prototype.init = function(_options) {
|
||||
};
|
||||
|
||||
Engine.prototype.startMonitor = function() {
|
||||
var self = this;
|
||||
if (this.plugins) {
|
||||
var servicePlugins = this.plugins.getPluginsFor('serviceChecks');
|
||||
servicePlugins.forEach(function(plugin) {
|
||||
plugin.serviceChecks.forEach(function(pluginCheck) {
|
||||
self.servicesMonitor.addCheck(pluginCheck.checkName, pluginCheck.checkFn, pluginCheck.time);
|
||||
});
|
||||
});
|
||||
}
|
||||
this.servicesMonitor.startMonitor();
|
||||
};
|
||||
|
||||
|
@ -17,6 +17,7 @@ var Plugin = function(options) {
|
||||
this.contractsConfigs = [];
|
||||
this.contractsFiles = [];
|
||||
this.compilers = [];
|
||||
this.serviceChecks = [];
|
||||
this.pluginTypes = [];
|
||||
this.logger = options.logger;
|
||||
this.events = options.events;
|
||||
@ -98,6 +99,11 @@ Plugin.prototype.registerConsoleCommand = function(cb) {
|
||||
this.pluginTypes.push('console');
|
||||
};
|
||||
|
||||
Plugin.prototype.registerServiceCheck = function(checkName, checkFn, time) {
|
||||
this.serviceChecks.push({checkName: checkName, checkFn: checkFn, time: time});
|
||||
this.pluginTypes.push('serviceChecks');
|
||||
};
|
||||
|
||||
Plugin.prototype.has = function(pluginType) {
|
||||
return this.pluginTypes.indexOf(pluginType) >= 0;
|
||||
};
|
||||
|
@ -14,6 +14,7 @@
|
||||
"buildDir": "dist/",
|
||||
"config": "config/",
|
||||
"plugins": {
|
||||
"embark-babel": {"files": ["**/*.js", "**/*.jsx", "!**/_vendor/*.js"]}
|
||||
"embark-babel": {"files": ["**/*.js", "**/*.jsx", "!**/_vendor/*.js"]},
|
||||
"embark-service": {}
|
||||
}
|
||||
}
|
||||
|
5
test_app/extensions/embark-service/index.js
Normal file
5
test_app/extensions/embark-service/index.js
Normal file
@ -0,0 +1,5 @@
|
||||
module.exports = function(embark) {
|
||||
embark.registerServiceCheck('PluginService', function(cb) {
|
||||
cb({name: "ServiceName", status: "green"});
|
||||
});
|
||||
};
|
11
test_app/extensions/embark-service/package.json
Normal file
11
test_app/extensions/embark-service/package.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "embark-service",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
}
|
@ -15,6 +15,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"embark-babel": "^1.0.0",
|
||||
"embark-service": "./extensions/embark-service",
|
||||
"ethereumjs-testrpc": "^3.0.3"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user