public function cleanupDeployments()
{
// Mark any pending steps as cancelled
ServerLog::where('status', '=', ServerLog::PENDING)->update(['status' => ServerLog::CANCELLED]);
// Mark any running steps as failed
ServerLog::where('status', '=', ServerLog::RUNNING)->update(['status' => ServerLog::FAILED]);
// Mark any running/pending deployments as failed
Deployment::whereIn('status', [Deployment::DEPLOYING, Deployment::PENDING])->update(['status' => Deployment::FAILED]);
// Mark any aborting deployments as aborted
Deployment::whereIn('status', [Deployment::ABORTING])->update(['status' => Deployment::ABORTED]);
// Mark any deploying/pending projects as failed
Project::whereIn('status', [Project::DEPLOYING, Project::PENDING])->update(['status' => Project::FAILED]);
}