Closed tommedema closed 6 years ago
Note that with plugins this can be solved by returning a promise (see https://github.com/serverless/serverless/issues/4557).
But in this case this is not possible since you are calling a node script without a function wrapper, and there is no return statement.
Fixed in the new version 0.7.0, could you please upgrade the module and have a test?
@tommedema Any updates on this issue?
Hey @weixu365 . I actually switched to using plugins, because I didn't like how this plugin requires me to use globals (serverless
and options
)
Let me know if you really want me to test this anyway
If I define a script like so:
It should run BEFORE
aws:package:finalize:saveServiceState
. SaveServiceState runs code that compiles the cloudformation template. I can then confirm if the script is run at the correct time by adding a log line at saveCompiledTemplate.js:And a log line in my script, which should run first:
And the console logs:
So, while it outputs
initializing
at the right time, the rest is executed afterawsInfo.getStackInfo()
resolves. Meanwhile serverless continues its work before my script can do its job.Serverless should pause execution while my script its doing its job.