Open wjensen-godaddy opened 2 years ago
@wjensen-godaddy thanks, I'm curious about your use case and whether it could be better solved with, for example, stage parameters in Compose config.
Could you share what is different between the files between dev and other stages?
@mnapoli For sure. This is what we need in prod:
# serverless-compose.yml
services:
elastic-search:
path: services/elastic-search
graph:
path: services/graph
params:
elasticUrl: ${elastic-search.url}
dynamo-event-mapping:
path: services/dynamo-event-mapping
params:
elasticUrl: ${elastic-search.url}
dynamoStreamArn: ${graph.dynamoStreamArn}
And this is what we need locally and in dev:
# serverless-compose.yml
services:
graph:
path: services/graph
We also support spinning up a deploy for each PR. And we want to give devs the options to deploy the full stack, or the skinny version.
Like you say, maybe there's a better way to support that than multiple config files?
We've also had some proposals that you could deploy only specific services - https://github.com/serverless/compose/issues/35 Looking at your use case, it also sounds like something that could solve the problem, correct?
@pgrzesik Possibly. Although if I filtered out elastic-search
, wouldn't my graph service complain that ${elastic-search.url}
can't be resolved?
Oh right, I've missed that part there, thanks for correction @wjensen-godaddy 👍
Another idea I had, is when issuing service specific commands, missing dependencies could be a warning instead of an error. That way I could run sls graph:offline
or sls graph:deploy
.
My current workaround, is I run (cd services/graph && sls offline)
.
any news about specific compose config?
Is there an existing issue for this?
Use case description
The services I need to run vary depending on the environment: local, dev, prod.
Proposed solution (optional)
It would be nice if I could have a config file for each of them, and then a way to tell serverless which one to use. Perhaps something like:
serverless deploy --config=serverless-compose-dev.yml