components
components copied to clipboard
Custom serverless components should return non-zero exit status on error
Description
Currently, with a custom serverless component (e.g a modified serverless.js), if an error is thrown in serverless.js while running serverless
, the exit status will be zero, indicating success. This makes it more difficult to ensure that a deploy was successful in an automated environment.
Proposal
Return a non-zero exit status if an error is thrown in serverless.js
Current workaround using tee (please suggest improvements if I'm just unaware of a better method)
serverless | tee sls.out # store cmd output to temporary file
! grep "error:" sls.out # grep for error string, negate exit code because not finding error string => serverless cmd was success