Deployments can fail for various reasons. A faulty deployment script might run before or after the deploy, or a bad script could execute before activating the release. Sometimes, things just go wrong, and previously, Fuse had no way to detect a failed deployment. It’s time to address this issue.
One way to detect a failed deployment is by using the exit code returned by the deployment script. The script uses a callback to notify Fuse when it finishes running, and it sends the along with the notification. If the exit code indicates failure, Fuse marks the deployment as failed.
There is another method to mark a deployment as failed, which is useful if the server never sends the callback to Fuse after the script finishes. This check happens in the deploy site job itself. Here, I check if the deployment is stale by verifying if it was created more than 10 minutes ago and is still marked as deploying. If so, it means the process is taking too long, and I mark the deployment as failed.
You can review all deployment statuses in the site deployments table to easily see which deployments failed and which succeeded.