From 500ba0fab8ba567fb2fe8f043d604044c893c8a3 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 28 Nov 2023 14:08:42 +0100 Subject: [PATCH] fix: do not remove deployment in case compose based failed --- app/Jobs/ApplicationDeploymentJob.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 7d229e879..153404c72 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -1289,9 +1289,13 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf"); $this->execute_remote_command( ["echo 'Oops something is not okay, are you okay? 😢'", 'type' => 'err'], ["echo '{$exception->getMessage()}'", 'type' => 'err'], - ["echo -n 'Deployment failed. Removing the new version of your application.'", 'type' => 'err'], - [executeInDocker($this->deployment_uuid, "docker rm -f $this->container_name >/dev/null 2>&1"), "hidden" => true, "ignore_errors" => true] ); + if ($this->application->build_pack !== 'dockercompose') { + $this->execute_remote_command( + ["echo -n 'Deployment failed. Removing the new version of your application.'", 'type' => 'err'], + [executeInDocker($this->deployment_uuid, "docker rm -f $this->container_name >/dev/null 2>&1"), "hidden" => true, "ignore_errors" => true] + ); + } $this->next(ApplicationDeploymentStatus::FAILED->value); }