add env vars

This commit is contained in:
Vahor 2024-08-27 16:45:07 +02:00
parent d8d821e7a9
commit 49a53236b0
No known key found for this signature in database

View File

@ -905,6 +905,19 @@ private function save_environment_variables()
$envs->push("COOLIFY_CONTAINER_NAME={$this->container_name}");
}
}
if ($this->application->environment_variables_preview->where('key', 'COOLIFY_APP_NAME')->isEmpty()) {
$envs->push("COOLIFY_APP_NAME={$this->application->name}");
}
if ($this->application->environment_variables_preview->where('key', 'COOLIFY_SERVER_IP')->isEmpty()) {
$envs->push("COOLIFY_SERVER_IP={$this->application->destination->server->ip}");
}
if ($this->application->environment_variables_preview->where('key', 'COOLIFY_ENVIRONMENT_NAME')->isEmpty()) {
$envs->push("COOLIFY_ENVIRONMENT_NAME={$this->application->environment->name}");
}
if ($this->application->environment_variables_preview->where('key', 'COOLIFY_PROJECT_NAME')->isEmpty()) {
$envs->push("COOLIFY_PROJECT_NAME={$this->application->project()->name}");
}
foreach ($sorted_environment_variables_preview as $env) {
$real_value = $env->real_value;
if ($env->version === '4.0.0-beta.239') {
@ -953,6 +966,19 @@ private function save_environment_variables()
$envs->push("COOLIFY_CONTAINER_NAME={$this->container_name}");
}
}
if ($this->application->environment_variables->where('key', 'COOLIFY_APP_NAME')->isEmpty()) {
$envs->push("COOLIFY_APP_NAME={$this->application->name}");
}
if ($this->application->environment_variables->where('key', 'COOLIFY_SERVER_IP')->isEmpty()) {
$envs->push("COOLIFY_SERVER_IP={$this->application->destination->server->ip}");
}
if ($this->application->environment_variables->where('key', 'COOLIFY_ENVIRONMENT_NAME')->isEmpty()) {
$envs->push("COOLIFY_ENVIRONMENT_NAME={$this->application->environment->name}");
}
if ($this->application->environment_variables->where('key', 'COOLIFY_PROJECT_NAME')->isEmpty()) {
$envs->push("COOLIFY_PROJECT_NAME={$this->application->project()->name}");
}
foreach ($sorted_environment_variables as $env) {
$real_value = $env->real_value;
if ($env->version === '4.0.0-beta.239') {