serverless / compose

Orchestrate Serverless Framework in monorepos
https://serverless.com/framework/docs/guides/compose
MIT License
110 stars 15 forks source link

Cannot run hook scripts in monorepo #165

Open 596050 opened 1 year ago

596050 commented 1 year ago

Are you certain it's a bug?

Are you using the latest version?

Is there an existing issue for this?

Issue description

Hello,

I''m trying to run hook scripts in individual apps for a monorepo.

When I try using the scripts plugins hooks:

serverless-plugin-scripts

and

serverless-scriptable-plugin

with something like

  custom: {
   ...
     scriptable: {
        // hooks used to invoke a lambda at the end of the deploy to populate the app secrets
        hooks: {
          "after:package:finalize": "sls invoke -f populateSSM",
        },
     }
  }
Screenshot 2022-11-23 at 13 10 26

Deployment is stuck, when I remove the hook script, it deploys as expected.

Do you know why that would be and where a fix needs to be made?

Service configuration (serverless-compose.yml) content

services:
  infrastructure-identity-verification:
    path: ./apps/infrastructure-identity-verification

  auth-service:
    path: ./apps/auth-service
    dependsOn:
      - infrastructure-identity-verification

  workers:
    path: ./apps/workers
    dependsOn:
      - infrastructure-identity-verification

  public-identity-verification:
    path: ./apps/public-identity-verification
    dependsOn:
      - infrastructure-identity-verification
      - workers

Command name and used flags

serverless deploy --stage=staging

Command output

N/A - output just hangs