Skip to content

Commit

Permalink
Allow custom section in serverless.yml to be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgf committed Apr 9, 2018
1 parent 4633c11 commit 987a80d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
6 changes: 3 additions & 3 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions example/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ plugins:
- serverless-plugin-aws-alerts
- serverless-plugin-canary-deployments

custom:
alerts:
dashboards: false

functions:
hello:
handler: handler.hello
Expand All @@ -29,7 +25,7 @@ functions:
- StreamsTestTable
- StreamArn
- sns: snsTopic
- s3: s3SampleBucket
- s3: s3samplebucket
alarms:
- name: foo
namespace: 'AWS/Lambda'
Expand Down
4 changes: 2 additions & 2 deletions serverless-plugin-canary-deployments.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class ServerlessCanaryDeployments {
);
return getMappingsForFunction(this.compiledTpl.Resources);
}

getS3EventsFor(functionName) {
const isEventSourceMapping = _.matchesProperty('Type', 'AWS::S3::Bucket');
const isMappingForFunction = _.pipe(
Expand Down Expand Up @@ -224,7 +224,7 @@ class ServerlessCanaryDeployments {
}

getDeploymentSettingsFor(serverlessFunction) {
const globalSettings = _.cloneDeep(this.service.custom.deploymentSettings);
const globalSettings = _.path('custom.deploymentSettings', this.service);
const fnDeploymentSetting = this.service.getFunction(serverlessFunction).deploymentSettings;
return Object.assign({}, globalSettings, fnDeploymentSetting);
}
Expand Down

0 comments on commit 987a80d

Please sign in to comment.