Closed marknorrapscm closed 3 years ago
I've had a closer look at your source code and it seems that most of what this project does it hook into existing functions provided by Serverless Framework itself, in which case this is likely a bug in that project rather than this.
I'm curious to hear your thoughts on this @mvila but I think I should probably re-create this in the main SLS repo.
My code is very simple indeed, and expressions such as {self:service}
should be handled by the Serverless Framework.
I am sorry but I don't think I can provide more help, I stopped using the Serverless Framework a long time ago, and I don't remember how it works anymore.
I know this project is in maintenance rather than active development; I am submitting this in the hope that bug fixes are still being implemented.
I am using hooks to run a function after I deploy my application.
I run
serverless deploy
and specify the stage with the--stage
option. The problem is that the above hook / function call does not seem to recognise whatever it is that I have specified as the stage. If I have set stage using the followingserverless.yml
config so that it uses whatever is supplied via the--stage
parameter:...then I get the following error when I deploy using
serverless deploy --stage prod
. The deploy runs correctly and theprod
value is used everywhere, but the hook does not recognise it and hasundefined
as the value:This is a major headache if the
runAfterDeploy
task does something important. Using${self:opt, "dev"}
instead produces a similar result, whereby no matter what you specify via--stage
the variable always ends up being"dev"
.Here's the full re-producible
serverless.yml
: