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.

Add build args to Final Build Command Preview in UI

Andras Bacsaibf503861fcb6
diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.php
index 71ca9720ee..ef474fb027 100644
--- a/app/Livewire/Project/Application/General.php
+++ b/app/Livewire/Project/Application/General.php
@@ -1018,11 +1018,27 @@ class General extends Component
// Use relative path for clarity in preview (e.g., ./backend/docker-compose.yaml)
// Actual deployment uses absolute path: /artifacts/{deployment_uuid}{base_directory}{docker_compose_location}
// Build-time env path references ApplicationDeploymentJob::BUILD_TIME_ENV_PATH as source of truth
- return injectDockerComposeFlags(
+ $command = injectDockerComposeFlags(
$this->dockerComposeCustomBuildCommand,
".{$normalizedBase}{$this->dockerComposeLocation}",
\App\Jobs\ApplicationDeploymentJob::BUILD_TIME_ENV_PATH
);
+
+ // Inject build args if not using build secrets
+ if (! $this->application->settings->use_build_secrets) {
+ $buildTimeEnvs = $this->application->environment_variables()
+ ->where('is_buildtime', true)
+ ->get();
+
+ if ($buildTimeEnvs->isNotEmpty()) {
+ $buildArgs = generateDockerBuildArgs($buildTimeEnvs);
+ $buildArgsString = $buildArgs->implode(' ');
+
+ $command = injectDockerComposeBuildArgs($command, $buildArgsString);
+ }
+ }
+
+ return $command;
}
public function getDockerComposeStartCommandPreviewProperty(): string