mirror of
https://github.com/cupcakearmy/coolify.git
synced 2024-10-22 08:04:19 +02:00
add env vars on old compose parser
This commit is contained in:
parent
7103dccc72
commit
2d9c583af3
@ -48,7 +48,7 @@ public function handle(Server $server)
|
||||
[FILTER]
|
||||
Name modify
|
||||
Match *
|
||||
Set server_name {$server->name}
|
||||
Set coolify.server_name {$server->name}
|
||||
Rename COOLIFY_APP_NAME coolify.app_name
|
||||
Rename COOLIFY_PROJECT_NAME coolify.project_name
|
||||
Rename COOLIFY_SERVER_IP coolify.server_ip
|
||||
@ -105,7 +105,7 @@ public function handle(Server $server)
|
||||
[FILTER]
|
||||
Name modify
|
||||
Match *
|
||||
Set server_name {$server->name}
|
||||
Set coolify.server_name {$server->name}
|
||||
Rename COOLIFY_APP_NAME coolify.app_name
|
||||
Rename COOLIFY_PROJECT_NAME coolify.project_name
|
||||
Rename COOLIFY_SERVER_IP coolify.server_ip
|
||||
|
@ -2106,6 +2106,21 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
||||
}
|
||||
}
|
||||
$parsedServiceVariables->put('COOLIFY_CONTAINER_NAME', "$serviceName-{$resource->uuid}");
|
||||
|
||||
// TODO: move this in a shared function
|
||||
if (! $parsedServiceVariables->has('COOLIFY_APP_NAME')) {
|
||||
$parsedServiceVariables->put('COOLIFY_APP_NAME', $resource->name);
|
||||
}
|
||||
if (! $parsedServiceVariables->has('COOLIFY_SERVER_IP')) {
|
||||
$parsedServiceVariables->put("COOLIFY_SERVER_IP", $resource->destination->server->ip);
|
||||
}
|
||||
if (! $parsedServiceVariables->has('COOLIFY_ENVIRONMENT_NAME')) {
|
||||
$parsedServiceVariables->put("COOLIFY_ENVIRONMENT_NAME", $resource->environment->name);
|
||||
}
|
||||
if (! $parsedServiceVariables->has('COOLIFY_PROJECT_NAME')) {
|
||||
$parsedServiceVariables->put('COOLIFY_PROJECT_NAME', $resource->project()->name);
|
||||
}
|
||||
|
||||
$parsedServiceVariables = $parsedServiceVariables->map(function ($value, $key) use ($envs_from_coolify) {
|
||||
if (! str($value)->startsWith('$')) {
|
||||
$found_env = $envs_from_coolify->where('key', $key)->first();
|
||||
|
Loading…
Reference in New Issue
Block a user