Skill 1.2.3

Measuring application health based on application exit codes

Key Concepts

In CodeBuild, any command that returns a non-zero exit code fails the current phase and the build. A failure in build skips to post_build, which still runs unless on-failure: ABORT is set. Scripts should use set -e (and set -o pipefail) so errors are not silently ignored.

CodeDeploy lifecycle hook scripts work the same way: a non-zero exit from ValidateService fails the deployment and can trigger rollback. Lambda hook functions report Succeeded or Failed through PutLifecycleEventHookExecutionStatus. Container health checks also rely on exit codes: a non-zero health check command marks the container unhealthy.