From 53965ab8edef11acf2655e8f839e42fc8fdff78c Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 2 Jan 2024 21:07:16 +0100 Subject: [PATCH] fix: set deployment failed if new container is not healthy --- app/Jobs/ApplicationDeploymentJob.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index e23496cd1..be28f3a26 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -1295,6 +1295,9 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf"); }); } else { $this->application_deployment_queue->addLogEntry("New container is not healthy, rolling back to the old container."); + $this->application_deployment_queue->update([ + 'status' => ApplicationDeploymentStatus::FAILED->value, + ]); $this->execute_remote_command( [executeInDocker($this->deployment_uuid, "docker rm -f $this->container_name >/dev/null 2>&1"), "hidden" => true, "ignore_errors" => true], );