compose icon indicating copy to clipboard operation
compose copied to clipboard

[RFC] Deploy `--with-dependents` to deploy dependent services

Open mnapoli opened this issue 2 years ago • 0 comments

Here's a feature request I had:

# Deploy "foo"
serverless-compose foo:deploy

# Deploy "foo" and all the services that depend on it
serverless-compose foo:deploy --with-dependents

In the example below, "bar" would be deployed, but not "baz":

services:

  foo:
    path: foo/
    dependsOn:
      - baz

  bar:
    path: foo/
    dependsOn:
      - foo

  baz:
    path: foo/

Use case: when changing (and deploying) a service, other services that depend on it might be impacted. So it might be worth redeploying these too.

Additional info:

  • dependencies are materialized via:
    • dependsOn
    • or by using another component's outputs (${bar.apiUrl})
  • nesting would be supported: given a -> b -> c, if a is deployed, then b and c would be deployed
  • if a service is not deployed because it didn't change, then its dependent services don't need to be deployed (if "a"'s deployment was skipped, then we can skip "b", and thus skip "c")
  • --with-dependents could be combined with #35 eventually

Feedback welcome!

mnapoli avatar Apr 08 '22 15:04 mnapoli