Philipp Muens 0944e6dde6 Refactor resource merging
So that the custom provider resources are not stored in a temp variable.
Furthermore the whole CloudFormation content is available in this.serverless.service.resources.
2016-08-12 17:42:18 +02:00

44 lines
1.1 KiB
JavaScript

'use strict';
const BbPromise = require('bluebird');
const validate = require('../lib/validate');
const createStack = require('./lib/createStack');
const uploadDeploymentPackage = require('./lib/uploadDeploymentPackage');
const deployFunctions = require('./lib/deployFunctions');
const updateStack = require('./lib/updateStack');
const SDK = require('../');
class AwsDeploy {
constructor(serverless, options) {
this.serverless = serverless;
this.options = options;
this.provider = 'aws';
this.sdk = new SDK(serverless);
Object.assign(
this,
validate,
createStack,
uploadDeploymentPackage,
deployFunctions,
updateStack
);
this.hooks = {
'before:deploy:initialize': () => BbPromise.bind(this)
.then(this.validate),
'deploy:setupProviderConfiguration': () => BbPromise.bind(this).then(this.createStack),
'deploy:deploy': () => BbPromise.bind(this)
.then(this.uploadDeploymentPackage)
.then(this.deployFunctions)
.then(this.updateStack)
.then(() => this.serverless.cli.log('Deployment successful!')),
};
}
}
module.exports = AwsDeploy;