mirror of
https://github.com/cupcakearmy/coolify.git
synced 2024-10-22 08:04:19 +02:00
add env vars for compose base apps
This commit is contained in:
parent
a245d16e05
commit
7103dccc72
@ -905,6 +905,8 @@ private function save_environment_variables()
|
||||
$envs->push("COOLIFY_CONTAINER_NAME={$this->container_name}");
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: move this in a shared function
|
||||
if ($this->application->environment_variables_preview->where('key', 'COOLIFY_APP_NAME')->isEmpty()) {
|
||||
$envs->push("COOLIFY_APP_NAME={$this->application->name}");
|
||||
}
|
||||
@ -966,6 +968,8 @@ private function save_environment_variables()
|
||||
$envs->push("COOLIFY_CONTAINER_NAME={$this->container_name}");
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: move this in a shared function
|
||||
if ($this->application->environment_variables->where('key', 'COOLIFY_APP_NAME')->isEmpty()) {
|
||||
$envs->push("COOLIFY_APP_NAME={$this->application->name}");
|
||||
}
|
||||
|
@ -1471,6 +1471,20 @@ public function newParser(int $pull_request_id = 0, ?int $preview_id = null)
|
||||
if ($this->environment_variables->where('key', 'COOLIFY_CONTAINER_NAME')->isEmpty()) {
|
||||
$environment->put('COOLIFY_CONTAINER_NAME', $containerName);
|
||||
}
|
||||
// TODO: move this in a shared function
|
||||
if ($this->environment_variables->where('key', 'COOLIFY_APP_NAME')->isEmpty()) {
|
||||
$environment->push("COOLIFY_APP_NAME={$this->database->name}");
|
||||
}
|
||||
if ($this->environment->where('key', 'COOLIFY_SERVER_IP')->isEmpty()) {
|
||||
$environment->push("COOLIFY_SERVER_IP={$this->database->destination->server->ip}");
|
||||
}
|
||||
if ($this->environment->where('key', 'COOLIFY_ENVIRONMENT_NAME')->isEmpty()) {
|
||||
$environment->push("COOLIFY_ENVIRONMENT_NAME={$this->database->environment->name}");
|
||||
}
|
||||
if ($this->environment->where('key', 'COOLIFY_PROJECT_NAME')->isEmpty()) {
|
||||
$environment->push("COOLIFY_PROJECT_NAME={$this->database->project()->name}");
|
||||
}
|
||||
|
||||
// Remove SERVICE_FQDN and SERVICE_URL from environment
|
||||
$environment = $environment->filter(function ($value, $key) {
|
||||
return ! str($key)->startsWith('SERVICE_FQDN') && ! str($key)->startsWith('SERVICE_URL');
|
||||
|
Loading…
Reference in New Issue
Block a user