fix(deployment): enhance COOLIFY_URL and COOLIFY_FQDN variable generation for better compatibility
This commit is contained in:
@@ -1347,9 +1347,16 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
|
||||
$fqdn = $this->preview->fqdn;
|
||||
}
|
||||
if (isset($fqdn)) {
|
||||
$this->coolify_variables .= "COOLIFY_FQDN={$fqdn} ";
|
||||
$url = str($fqdn)->replace('http://', '')->replace('https://', '');
|
||||
$this->coolify_variables .= "COOLIFY_URL={$url} ";
|
||||
$fqdnWithoutPort = str($fqdn)->after('://')->before(':')->prepend(str($fqdn)->before('://')->append('://'));
|
||||
$url = str($fqdn)->replace('http://', '')->replace('https://', '')->before(':');
|
||||
if ((int) $this->application->compose_parsing_version >= 3) {
|
||||
$this->coolify_variables .= "COOLIFY_URL={$fqdnWithoutPort} ";
|
||||
$this->coolify_variables .= "COOLIFY_FQDN={$url} ";
|
||||
} else {
|
||||
$this->coolify_variables .= "COOLIFY_URL={$fqdnWithoutPort} ";
|
||||
$this->coolify_variables .= "COOLIFY_FQDN={$url} ";
|
||||
}
|
||||
|
||||
}
|
||||
if (isset($this->application->git_branch)) {
|
||||
$this->coolify_variables .= "COOLIFY_BRANCH={$this->application->git_branch} ";
|
||||
|
||||
@@ -1264,7 +1264,6 @@ class Service extends BaseModel
|
||||
foreach ($sorted as $env) {
|
||||
$envs->push("{$env->key}={$env->real_value}");
|
||||
}
|
||||
ray($envs);
|
||||
if ($envs->count() === 0) {
|
||||
$commands[] = 'touch .env';
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user