@valiton/serverless-s3-deploy
v0.7.3
Published
A plugin for the serverless framework to store builds in s3 and deploy pre-built images from s3.
Downloads
7
Readme
Serverless S3 Deploy Plugin
This Plugin allows you to do 2 things
- When you package your service it uploads them t an S3 bucket.
- When you want to deploy it pull your prepackaged service from S3 and deploys it.
This can be useful if you want to separate the build and deployment step in your CI setup.
How to use
npm i -D @valiton/serverless-s3-deploy
Use node version 8 or higher. The only dependency of this plugin is the aws-sdk
.
Add the plugin to your serverless.yml
file in the plugins
section
and add a custom configuration(required).
plugins:
- '@valiton/serverless-s3-deploy' # <--- add the plugin
...
custom:
deploy-s3:
# S3-bucket to put your packaged services (e.g. serverless-package-artifacts)
bucket: your-bucket
# path in S3 (key prefix) to store your packaged services
# for example '${self:service}/${opt:tag}'
path: 'path/to/folder'
The plugin exposes 2 commands, package-s3
, deploy-s3
which are described below.
API
Build and store on S3
serverless package-s3 --tag tagOrBranch --package some-folder
Fetch from S3 and deploy
serverless deploy-s3 --tag tagOrBranch --package some-folder