fix(previews): refine preview domain generation for Docker Compose applications, ensuring correct method usage based on build pack type

This commit is contained in:
Andras Bacsai
2025-07-14 15:47:16 +02:00
parent a9e542bc4b
commit 8a107b3c4b

View File

@@ -229,7 +229,16 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
// Set preview fqdn
if ($this->pull_request_id !== 0) {
if ($this->application->build_pack === 'dockercompose') {
// For Docker Compose apps, use the preview model's compose-specific method
$this->preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->application->id, $this->pull_request_id);
if ($this->preview) {
$this->preview->generate_preview_fqdn_compose();
}
} else {
// For non-Docker Compose apps, use the application model's method
$this->preview = $this->application->generate_preview_fqdn($this->pull_request_id);
}
if ($this->application->is_github_based()) {
ApplicationPullRequestUpdateJob::dispatch(application: $this->application, preview: $this->preview, deployment_uuid: $this->deployment_uuid, status: ProcessStatus::IN_PROGRESS);
}