serverless-package
v0.2.0
Published
An alternative approach to packaging for Serverless
Readme
serverless-package
An alternative approach to packaging for Serverless
Why?
Unlike most, I write my serverless apps in Python.
When including third party packages, it can be quite messy, especially for the output of git status.
This approach allows me to install them into a dist/ directory using "pip install -t dist/ ..." and then .gitignore that directory.
Usage
Add "serverless-packages" to your plugins list.
Specify an artifact in your existing package config
This disables the built in packager, and enables this one.
Add a custom.package section
This is a map of root paths to lists of glob-all terms.
Example
plugins:
- serverless-package
package:
artifact: .serverless/package.zip
custom:
package:
sources:
"./src/":
- "**" # Include everything
- "!**/*.pyc" # Except the .pyc files
"./dist/":
- "**" # Include everything
- "!**/*.pyc" # Except .pyc files
- "!*@(dist|egg)-info/**" # Or pip's book-keeping filesCommand
Additionally, this adds the "package" command.
sls packageThis will only run the serverless-package command, not the built in packaging.
