Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom serverless components should return non-zero exit status on error #855

Open
epleaner opened this issue Dec 30, 2020 · 0 comments
Open

Comments

@epleaner
Copy link

epleaner commented Dec 30, 2020

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant