CodeBuild always succeeds even when serverless fails

I’m using CodeBuild to deploy serverless currently and ran into a little hangup: Only the actual build step in the buildspec.yml I run:

serverless deploy --stage $STAGE --region $REGION | tee deploy.out

Now this will run and output logs accordingly BUT … codebuild will log “succeeded” regardless of if the process actually works or not, even on errors like a badly formed serverless.yml.

I’m guessing it has to do with “tee” at the end of the command … how do others do this?

1 Like

@Justin-DynamicD did you find a solution to this issue?