What I need:
Is there a way to specify which serverless.yml file I want to deploy?
sls deploy uses serverless.yml to deploy but I have multiple .yml files (serverless-1.yml, serverless-2.yml so on) Why? I’ll explain it at the end.
What I currently do:
- Change the name from serverless-1.yml to serverless.yml then
- Change the name from serverless.yml to serverless-1.yml then
- Change the name from serverless-2.yml to serverless.yml then
What I need
To specify which .yml file I want to deploy so I don’t have to change the names to serverless.yml
sls deploy --file serverless-1.yml
sls deploy --file serverless-2.yml
Why do I have multiple YAML files under the same directory?
Well I’ve hit the CF 200 resources limit a long time ago, I’ve tried plugins such as split stacks, nested stacks and additional stacks none of them worked, so I’m using microservices now I have to divide my service into small services (30 or 35 functions per serverless.yml)
I realized that putting the serverless.yml file under a directory made that directory the microservice thus I could not invoke or use anything outside that directory (utils functions and node_modules) I don’t want to put a node_modules inside each microservice and I dont want to copy and paste my utils functions in each microservice (is obvious why), so I ended up having my microservices to be the same the only thing that changes is the yml file (inside the functions I declare) and the index.js file