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 support for dynamic docker-compose file name in ApplicationDeploymentJob.php

Andras Bacsai423cf62d92af
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php
index fbf6ef0056..ca01b8d500 100644
--- a/app/Jobs/ApplicationDeploymentJob.php
+++ b/app/Jobs/ApplicationDeploymentJob.php
@@ -218,12 +218,16 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
} finally {
if (isset($this->docker_compose_base64)) {
$readme = generate_readme_file($this->application->name, $this->application_deployment_queue->updated_at);
+ $composeFileName = "$this->configuration_dir/docker-compose.yml";
+ if ($this->pull_request_id !== 0) {
+ $composeFileName = "$this->configuration_dir/docker-compose-pr-{$this->pull_request_id}.yml";
+ }
$this->execute_remote_command(
[
"mkdir -p $this->configuration_dir"
],
[
- "echo '{$this->docker_compose_base64}' | base64 -d > $this->configuration_dir/docker-compose.yml",
+ "echo '{$this->docker_compose_base64}' | base64 -d > $composeFileName",
],
[
"echo '{$readme}' > $this->configuration_dir/README.md",