Skip to content

Serverless Framework Plugin for transforming git branch name to a Serverless stage name

License

Notifications You must be signed in to change notification settings

purple-technology/serverless-git-branch-stage-plugin

Repository files navigation

serverless-git-branch-stage-plugin

CI Status Badge

This plugin provides two Serverless variables:

  • git:stage - branch name converted to camel case
  • git:basePath - branch name converted to kebab-case which is usefull for serverless-domain-manager plugin

Install

$ npm install --save-dev @purple/serverless-git-branch-stage-plugin

Add the plugin to your serverless.yml file

plugins:
  - '@purple/serverless-git-branch-stage-plugin'

Prerequisites:

This plugin requires git to be installed.
Tested on Linux and macOS.

Example

provider:
  name: aws
  stage: ${git:stage}
custom:
  customDomain:
    domainName: serverless.foo.com
    basePath:  ${git:basePath}

Overriding branch name

You can override the branch name with envrionment variable SLS_MOCK_BRANCH.

$ SLS_MOCK_BRANCH=master serverless deploy 

About

Serverless Framework Plugin for transforming git branch name to a Serverless stage name

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •