2016-08-16 07:53:24 +10:00

32 lines
662 B
JavaScript

'use strict';
const BbPromise = require('bluebird');
const validate = require('./lib/validate');
const zipService = require('./lib/zipService');
const cleanup = require('./lib/cleanup');
class Package {
constructor(serverless, options) {
this.serverless = serverless;
this.options = options;
Object.assign(
this,
validate,
zipService,
cleanup
);
this.hooks = {
'deploy:cleanup': () => BbPromise.bind(this)
.then(this.cleanup),
'deploy:createDeploymentArtifacts': () => BbPromise.bind(this)
.then(this.validate)
.then(this.zipService),
};
}
}
module.exports = Package;