From 126ac354d57a4902cdd539be51ff16e7b18c3054 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 19 Feb 2024 09:19:50 +0100 Subject: [PATCH] fix: empty build variables --- app/Jobs/ApplicationDeploymentJob.php | 30 +++++++++++++++++---------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index aa68c20ad..2dafcee43 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -279,13 +279,13 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted } else { $this->write_deployment_configurations(); } - $this->execute_remote_command( - [ - "docker rm -f {$this->deployment_uuid} >/dev/null 2>&1", - "hidden" => true, - "ignore_errors" => true, - ] - ); + // $this->execute_remote_command( + // [ + // "docker rm -f {$this->deployment_uuid} >/dev/null 2>&1", + // "hidden" => true, + // "ignore_errors" => true, + // ] + // ); $this->execute_remote_command( [ "docker image prune -f >/dev/null 2>&1", @@ -1022,11 +1022,15 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted $this->env_nixpacks_args = collect([]); if ($this->pull_request_id === 0) { foreach ($this->application->nixpacks_environment_variables as $env) { - $this->env_nixpacks_args->push("--env {$env->key}={$env->real_value}"); + if (!is_null($env->real_value)) { + $this->env_nixpacks_args->push("--env {$env->key}={$env->real_value}"); + } } } else { foreach ($this->application->nixpacks_environment_variables_preview as $env) { - $this->env_nixpacks_args->push("--env {$env->key}={$env->real_value}"); + if (!is_null($env->real_value)) { + $this->env_nixpacks_args->push("--env {$env->key}={$env->real_value}"); + } } } @@ -1037,11 +1041,15 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted $this->env_args = collect([]); if ($this->pull_request_id === 0) { foreach ($this->application->build_environment_variables as $env) { - $this->env_args->put($env->key, $env->real_value); + if (!is_null($env->real_value)) { + $this->env_args->put($env->key, $env->real_value); + } } } else { foreach ($this->application->build_environment_variables_preview as $env) { - $this->env_args->put($env->key, $env->real_value); + if (!is_null($env->real_value)) { + $this->env_args->put($env->key, $env->real_value); + } } } $this->env_args->put('SOURCE_COMMIT', $this->commit);