wildcard domains

This commit is contained in:
Andras Bacsai
2023-05-22 11:21:03 +02:00
parent ecf0b30513
commit 8f7fd4295e
6 changed files with 68 additions and 22 deletions

View File

@@ -101,21 +101,10 @@ class DeployApplicationJob implements ShouldQueue
public function handle(): void
{
try {
$coolify_instance_settings = InstanceSettings::get();
if ($this->application->deploymentType() === 'source') {
$this->source = $this->application->source->getMorphClass()::where('id', $this->application->source->id)->first();
}
// Get Wildcard Domain
$project_wildcard_domain = data_get($this->application, 'environment.project.settings.wildcard_domain');
$global_wildcard_domain = data_get($coolify_instance_settings, 'wildcard_domain');
$wildcard_domain = $project_wildcard_domain ?? $global_wildcard_domain ?? null;
// Set wildcard domain
if (!$this->application->fqdn && $wildcard_domain) {
$this->application->fqdn = 'http://' . $this->application->uuid . '.' . $wildcard_domain;
$this->application->save();
}
$this->workdir = "/artifacts/{$this->deployment_uuid}";
// Pull builder image