From 23b5a3e561e91444618bbc9805a3100ede0505a1 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Tue, 13 Jan 2026 12:43:18 +0100 Subject: [PATCH] fix(env): only cat .env file in dev --- app/Jobs/ApplicationDeploymentJob.php | 29 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 84f362519..5dec20b4d 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -1390,14 +1390,18 @@ private function save_runtime_environment_variables() $this->execute_remote_command( [ executeInDocker($this->deployment_uuid, "echo '$envs_base64' | base64 -d | tee $this->workdir/.env > /dev/null"), - ], - [ - executeInDocker($this->deployment_uuid, "cat $this->workdir/.env"), - 'hidden' => true, - ] ); + if (isDev()) { + $this->execute_remote_command( + [ + executeInDocker($this->deployment_uuid, "cat $this->workdir/.env"), + 'hidden' => true, + ] + ); + } + // Write .env file to configuration directory if ($this->use_build_server) { $this->server = $this->mainServer; @@ -1649,12 +1653,17 @@ private function save_buildtime_environment_variables() $this->execute_remote_command( [ executeInDocker($this->deployment_uuid, "echo '$envs_base64' | base64 -d | tee ".self::BUILD_TIME_ENV_PATH.' > /dev/null'), - ], - [ - executeInDocker($this->deployment_uuid, 'cat '.self::BUILD_TIME_ENV_PATH), - 'hidden' => true, - ], + ] ); + + if (isDev()) { + $this->execute_remote_command( + [ + executeInDocker($this->deployment_uuid, 'cat '.self::BUILD_TIME_ENV_PATH), + 'hidden' => true, + ] + ); + } } elseif ($this->build_pack === 'dockercompose' || $this->build_pack === 'dockerfile') { // For Docker Compose and Dockerfile, create an empty .env file even if there are no build-time variables // This ensures the file exists when referenced in build commands