From b68199a4825b08d7f8b817c9ab39e95773a12220 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 22 Jul 2024 15:09:50 +0200 Subject: [PATCH] fix: Fix issue with deployment start command in ApplicationDeploymentJob --- app/Jobs/ApplicationDeploymentJob.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index b67e29f72..b3ca3185f 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -490,10 +490,10 @@ private function deploy_docker_compose_buildpack() // Start compose file if ($this->application->settings->is_raw_compose_deployment_enabled) { if ($this->docker_compose_custom_start_command) { + $this->write_deployment_configurations(); $this->execute_remote_command( [executeInDocker($this->deployment_uuid, "cd {$this->workdir} && {$this->docker_compose_custom_start_command}"), 'hidden' => true], ); - $this->write_deployment_configurations(); } else { $this->write_deployment_configurations(); $server_workdir = $this->application->workdir(); @@ -510,22 +510,21 @@ private function deploy_docker_compose_buildpack() } } else { if ($this->docker_compose_custom_start_command) { + $this->write_deployment_configurations(); $this->execute_remote_command( [executeInDocker($this->deployment_uuid, "cd {$this->basedir} && {$this->docker_compose_custom_start_command}"), 'hidden' => true], ); - $this->write_deployment_configurations(); } else { $command = "{$this->coolify_variables} docker compose"; if ($this->env_filename) { $command .= " --env-file {$this->workdir}/{$this->env_filename}"; } $command .= " --project-name {$this->application->uuid} --project-directory {$this->workdir} -f {$this->workdir}{$this->docker_compose_location} up -d"; - ray($command); + $this->write_deployment_configurations(); $this->execute_remote_command( [executeInDocker($this->deployment_uuid, $command), 'hidden' => true], ); - $this->write_deployment_configurations(); } } @@ -615,14 +614,14 @@ private function write_deployment_configurations() $this->server = $this->original_server; } if (str($this->configuration_dir)->isNotEmpty()) { - ray("docker cp {$this->deployment_uuid}:{$this->workdir} {$this->configuration_dir}"); $this->execute_remote_command( [ "mkdir -p $this->configuration_dir", ], - [ - "rm -rf $this->configuration_dir/{*,.*}", - ], + // removing this now as we are using docker cp + // [ + // "rm -rf $this->configuration_dir/{*,.*}", + // ], [ "docker cp {$this->deployment_uuid}:{$this->workdir}/. {$this->configuration_dir}", ],