New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

serverless-plugin-canary-deployments

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-plugin-canary-deployments - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

fixtures/4.input.disabled-stage.json

3

CHANGELOG.md

@@ -0,1 +1,4 @@

# 0.4.2 (18.04.2018)
- Add configuration for enabling canary deployments on a per stage basis
# 0.4.1 (16.04.2018)

@@ -2,0 +5,0 @@ - Add configurable Role for CodeDeploy

{
"service": "canary-deployments-test",
"custom": {
"deploymentSettings": {
"stages": [
"dev"
]
}
},
"functions": {

@@ -4,0 +11,0 @@ "hello": {

2

package.json

@@ -6,3 +6,3 @@ {

},
"version": "0.4.1",
"version": "0.4.2",
"description": "A Serverless plugin to implement canary deployment of Lambda functions",

@@ -9,0 +9,0 @@ "main": "serverless-plugin-canary-deployments.js",

@@ -75,2 +75,5 @@ [![npm version](https://badge.fury.io/js/serverless-plugin-canary-deployments.svg)](https://badge.fury.io/js/serverless-plugin-canary-deployments)

codeDeployRole: some_arn_value
stages:
- dev
- prod

@@ -83,3 +86,4 @@ functions:

* `codeDeployRole`: (optional) an arn specifying an existing IAM role for CodeDeploy. If absent, one will be created for you. See the [codeDeploy policy](./example-code-deploy-policy.json) for an example of what is needed.
* `codeDeployRole`: (optional) an ARN specifying an existing IAM role for CodeDeploy. If absent, one will be created for you. See the [codeDeploy policy](./example-code-deploy-policy.json) for an example of what is needed.
* `stages`: (optional) list of stages where you want to deploy your functions gradually. If not present, it assumes that are all of them.

@@ -86,0 +90,0 @@ ## How it works

@@ -36,4 +36,8 @@ const _ = require('lodash/fp');

get currentStage() {
return this.awsProvider.getStage();
}
addCanaryDeploymentResources() {
if (this.withDeploymentPreferencesFns.length > 0) {
if (this.shouldDeployDeployGradually()) {
const codeDeployApp = this.buildCodeDeployApp();

@@ -51,2 +55,11 @@ const codeDeployRole = this.buildCodeDeployRole();

shouldDeployDeployGradually() {
return this.withDeploymentPreferencesFns.length > 0 && this.currentStageEnabled();
}
currentStageEnabled() {
const enabledStages = _.getOr([], 'stages', this.globalSettings);
return _.isEmpty(enabledStages) || _.includes(this.currentStage, enabledStages);
}
buildFunctionsResources() {

@@ -53,0 +66,0 @@ return _.flatMap(

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc