serverless-stage-manager
Super simple serverless plugin for validating stage names before deployment.
Installation
Install using Serverless plugin manager
serverless plugin install --name serverless-stage-manager
Install using npm
Install the module using npm:
npm install serverless-stage-manager --save-dev
Add serverless-stage-manager
to the plugin list of your serverless.yml
file:
plugins: - serverless-stage-manager
Configuration
Add a stages
value in the custom
section of your serverless.yml
file and specify an array of valid stage names.
custom: stages: - dev - staging - prod
Usage
When running serverless deploy
or serverless deploy function
, it will check to make sure it is a valid stage name before continuing. For example:
# Given the above configuration of dev, staging & prod# These will workserverless deploy -s prodserverless deploy -s stagingserverless deploy function -f funcName -s devserverless deploy # assuming default stage is in custom.stages config# These will failserverless deploy -s fooserverless deploy function -f funcName -s bar