Skip to content

Commit

Permalink
Merge pull request serverless#5265 from serverless/backend-state-item…
Browse files Browse the repository at this point in the history
…s-multi-region

Backend state item generation and multi-region support
  • Loading branch information
pmuens authored Sep 17, 2018
2 parents cfc2ac8 + d9c7689 commit 8911af1
Show file tree
Hide file tree
Showing 7 changed files with 1,610 additions and 1,917 deletions.
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 1.32.0 (17.09.2018)
- [Update quick-start.md](https://github.com/serverless/serverless/pull/5290)
- [Backend state item generation and multi-region support](https://github.com/serverless/serverless/pull/5265)

## Meta
- [Comparison since last release](https://github.com/serverless/serverless/compare/v1.31.0...v1.32.0)


# 1.31.0 (11.09.2018)
- [Add support for Cloudflare Workers](https://github.com/serverless/serverless/pull/5258)
- [docs: Fix mismatch in AWS Metrics](https://github.com/serverless/serverless/pull/5276)
Expand All @@ -9,10 +17,10 @@
- [Fix for #3069 - Failing to handle schedule event body params](https://github.com/serverless/serverless/pull/5268)
- [Remove redundant link to same docs page](https://github.com/serverless/serverless/pull/5243)


## Meta
- [Comparison since last release](https://github.com/serverless/serverless/compare/v1.30.3...v1.31.0)


# 1.30.3 (28.08.2018)
- [Fix CORS race condition](https://github.com/serverless/serverless/pull/5256)

Expand All @@ -37,6 +45,7 @@
## Meta
- [Comparison since last release](https://github.com/serverless/serverless/compare/v1.30.0...v1.30.1)


# 1.30.0 (09.08.2018)
- [Added support for multiple access keys for multiple tenants](https://github.com/serverless/serverless/pull/5189)
- [Fixed a publishing bug when having more than 100 resources](https://github.com/serverless/serverless/pull/5189)
Expand All @@ -52,19 +61,22 @@
## Meta
- [Comparison since last release](https://github.com/serverless/serverless/compare/v1.29.2...v1.30.0)


# 1.29.2 (29.07.2018)
- [Fixed a bug when using APIG lambda integration with Serverless Dashboard](https://github.com/serverless/serverless/pull/5174)
- [Fixed a bug by transforming env var to string when setting num value](https://github.com/serverless/serverless/pull/5166)

## Meta
- [Comparison since last release](https://github.com/serverless/serverless/compare/v1.29.1...v1.29.2)


# 1.29.1 (28.07.2018)
- [Fixed a bug when using APIG root path with Serverless Dashboard](https://github.com/serverless/serverless/pull/5170)

## Meta
- [Comparison since last release](https://github.com/serverless/serverless/compare/v1.29.0...v1.29.1)


# 1.29.0 (26.07.2018)
- [Fixes issue with Node 10.7.0](https://github.com/serverless/serverless/issues/5133)
- [Serverless Dashboard Updates: Subscriptions, Resources, Deploys and Refresh Tokens](https://github.com/serverless/serverless/pull/5127)
Expand All @@ -74,6 +86,7 @@
## Meta
- [Comparison since last release](https://github.com/serverless/serverless/compare/v1.28.0...v1.29.0)


# 1.28.0 (04.07.2018)
- [Add SQS event integration](https://github.com/serverless/serverless/pull/5074)
- [Integration with the Serverless Dashboard](https://github.com/serverless/serverless/pull/5043)
Expand All @@ -91,6 +104,7 @@
## Meta
- [Comparison since last release](https://github.com/serverless/serverless/compare/v1.27.0...v1.28.0)


# 1.27.0 (02.05.2018)
- [Add maxAge option for CORS](https://github.com/serverless/serverless/pull/4639)
- [Add fn integration](https://github.com/serverless/serverless/pull/4934)
Expand Down Expand Up @@ -118,6 +132,7 @@
## Meta
- [Comparison since last release](https://github.com/serverless/serverless/compare/v1.26.0...v1.26.1)


# 1.26.0 (29.01.2018)
- [AWS Go support](https://github.com/serverless/serverless/pull/4669)
- [Support for using an existing ApiGateway and Resources](https://github.com/serverless/serverless/pull/4247)
Expand Down Expand Up @@ -205,7 +220,6 @@
- [Fixed a bug with Kinesis events](https://github.com/serverless/serverless/pull/4084)
- [Fixed a bug with packaging](https://github.com/serverless/serverless/pull/4189)


## Meta
- [Comparison since last release](https://github.com/serverless/serverless/compare/v1.21.1...v1.22.0)

Expand Down
9 changes: 9 additions & 0 deletions lib/plugins/aws/deploy/lib/createDeployment.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
'use strict';

const path = require('path');
const fs = require('fs');
const platform = require('@serverless/platform-sdk');
const BbPromise = require('bluebird');
const getAccessKey = require('../../../../utils/getAccessKey');

module.exports = {
createDeployment() {
const serverlessStateFilePath = path.join(
this.serverless.config.servicePath, '.serverless', 'serverless-state.json');
const serverlessStateFileContent = JSON.parse(fs.readFileSync(serverlessStateFilePath, 'utf8'));

return getAccessKey(this.serverless.service.tenant).then(accessKey => {
if (accessKey && this.serverless.service.app &&
this.serverless.service.tenant &&
Expand All @@ -15,6 +21,9 @@ module.exports = {
app: this.serverless.service.app,
accessKey,
serviceName: this.serverless.service.service,
files: {
'serverless-state.json': serverlessStateFileContent,
},
};
return platform.createDeployment(deploymentData)
.then((res) => {
Expand Down
3 changes: 3 additions & 0 deletions lib/plugins/aws/deploy/lib/createStack.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ describe('createStack', () => {
const createStackStub = sandbox
.stub(awsDeploy.provider, 'request').resolves();
sandbox.stub(awsDeploy, 'monitorStack').resolves();
sandbox.stub(awsDeploy, 'createDeployment').resolves();

return awsDeploy.create().then(() => {
expect(createStackStub.args[0][2].Tags)
Expand All @@ -66,6 +67,7 @@ describe('createStack', () => {
const createStackStub = sandbox
.stub(awsDeploy.provider, 'request').resolves();
sandbox.stub(awsDeploy, 'monitorStack').resolves();
sandbox.stub(awsDeploy, 'createDeployment').resolves();

return awsDeploy.create().then(() => {
expect(createStackStub.args[0][2].RoleARN)
Expand All @@ -80,6 +82,7 @@ describe('createStack', () => {
const createStackStub = sinon
.stub(awsDeploy.provider, 'request').resolves();
sinon.stub(awsDeploy, 'monitorStack').resolves();
sinon.stub(awsDeploy, 'createDeployment').resolves();

return awsDeploy.create().then(() => {
expect(createStackStub.args[0][2].NotificationARNs)
Expand Down
2 changes: 2 additions & 0 deletions lib/plugins/aws/deploy/lib/validateTemplate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ describe('validateTemplate', () => {
},
};
validateTemplateStub = sinon.stub(awsDeploy.provider, 'request');
sinon.stub(awsDeploy, 'createDeployment').resolves();
awsDeploy.serverless.cli = {
log: sinon.spy(),
};
});

afterEach(() => {
awsDeploy.provider.request.restore();
awsDeploy.createDeployment.restore();
});

describe('#validateTemplate()', () => {
Expand Down
Loading

0 comments on commit 8911af1

Please sign in to comment.