I have two serverless.yml for two different services, my project structure is as below:
my bitbucket-pipeline.yml looks something like this:
pipelines:
branches:
master:
- step:
name: Deploy Authorizer
caches:
- node
script:
- pipe: atlassian/serverless-deploy:0.2.2
variables:
CONFIG: "./src/auth/serverless.yml"
[AWS_CREDS]
- step:
name: Deploy to Production
deployment: production
caches:
- node
script:
- npm install
- pipe: atlassian/serverless-deploy:0.2.2
variables:
[AWS_CREDS]
My auth/serverless.yml has this in it:
package:
include:
- handler.js
My service and auth lambdas get deployed successfully, but the zipped package for my auth lambda includes my entire project, even with the package/include specifying that I only want that one handler.js file included.
This causes issues when the lambda is deployed since the serverless.yml specifies the handler path relative to the serverless.yml, but once it's in AWS with all the extra project files, the relative path breaks and it can't execute the code in handler.js
Right now, this seems like a bug because when just doing a:
serverless package
in my auth directory, the handler.js is correctly the only file that's in the zipped package. But through the bitbucket pipe, it ignores the include option and shoves everything in there.