Philipp Muens b74fa46563 Update hook order and zipping functionality
Update the hook order because the functions need the .zip file in their resource
definition. Furthermore the zipping process / writing it to disc was optimized.
The ".serverless" directory is also added to the "default exclude array" so that it's not
considered during packaging.
2016-07-07 20:10:05 +02:00
..
2016-07-07 20:10:05 +02:00
2016-07-07 20:10:05 +02:00

Package

This plugin creates a deployment package on a per service basis (it will zip up all code for the whole service).

How it works

Package starts by hooking into the deploy:createDeploymentPackage lifecycle.

It will zip the whole service directory. The artifact will be stored in the .serverless directory which will be created upon zipping the service. The resulting path to the artifact will be appended to the service.package.artifact property.

The services include and exclude arrays are considered during zipping. At first the exclude will be applied. After that the include will be applied to ensure that previously excluded files and folders can be included again.

Serverless will automatically exclude .git, .gitignore, serverless.yaml, serverless.env.yaml and .DS_Store.

Servlerless will skip this step if the user has defined it's own artifact in the service.package.artifact property.

At the end it will do a cleanup by hooking into the [after:deploy:deploy](/lib/plugins/deploy) lifecycle to remove the .serverless directory.