Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix(env): only cat .env file in dev

peaklabs-dev23b5a3e561e9
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php
index 84f362519d..5dec20b4d0 100644
--- a/app/Jobs/ApplicationDeploymentJob.php
+++ b/app/Jobs/ApplicationDeploymentJob.php
@@ -1390,14 +1390,18 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
$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 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
$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