embark/packages/plugins/deploy-tracker/src/index.js

20 lines
904 B
JavaScript
Raw Normal View History

import DeploymentChecks from "./deploymentChecks";
import TrackingFunctions from "./trackingFunctions";
2016-09-25 01:10:47 +00:00
2017-03-30 11:12:39 +00:00
class DeployTracker {
2018-05-19 02:40:47 +00:00
constructor(embark, {trackContracts, plugins}) {
const {logger, events, fs, config} = embark;
this.embark = embark;
2018-05-19 02:40:47 +00:00
const trackingFunctions = new TrackingFunctions({config, fs, logger, events, trackContracts});
const deploymentChecks = new DeploymentChecks({trackingFunctions, logger, events, plugins});
2018-05-19 02:40:47 +00:00
this.embark.registerActionForEvent("deployment:contract:deployed", trackingFunctions.trackAndSaveContract.bind(trackingFunctions));
this.embark.registerActionForEvent("deployment:contract:shouldDeploy", deploymentChecks.checkContractConfig.bind(deploymentChecks));
this.embark.registerActionForEvent("deployment:contract:shouldDeploy", deploymentChecks.checkIfAlreadyDeployed.bind(deploymentChecks));
2018-05-19 02:40:47 +00:00
}
2017-03-30 11:12:39 +00:00
}
2016-09-25 01:10:47 +00:00
module.exports = DeployTracker;