Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

Latest commit

 

History

History
39 lines (30 loc) · 1.02 KB

Usage.md

File metadata and controls

39 lines (30 loc) · 1.02 KB

USAGE

Serverless build uses the sls deploy and sls deploy function CLI commands, overriding the standard build functionality.

  • Configure serverless build
  • Configure serverless with AWS credentials
  • sls deploy to deploy your resources and all functions at once
  • sls invoke -l -f <fnName> to invoke a deployed function
  • sls deploy function -f <fnName> to deploy a single function
  • NODE_ENV=production sls deploy function -f <fnName> when your build process cares about process.env.NODE_ENV

TEST IT OUT

If you'd like to test out a preconfigured project...

git clone git@github.com:nfour/serverless-build-plugin
cd serverless-build-plugin
yarn
yarn build
yarn link
cd test/1.0
yarn
yarn link serverless-build-plugin

sls deploy
sls invoke -f one -l
sls deploy function -f two
sls invoke -f two -l

If you want to audit the built zip, run:

sls package

Then check the .serverless/artifacts directory