refactor: Update Docker Compose parsing function to convert service variables to key-value pairs
This commit is contained in:
@@ -2120,6 +2120,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
|||||||
$yaml = data_forget($yaml, 'services.*.volumes.*.content');
|
$yaml = data_forget($yaml, 'services.*.volumes.*.content');
|
||||||
$resource->docker_compose_raw = Yaml::dump($yaml, 10, 2);
|
$resource->docker_compose_raw = Yaml::dump($yaml, 10, 2);
|
||||||
$resource->docker_compose = Yaml::dump($finalServices, 10, 2);
|
$resource->docker_compose = Yaml::dump($finalServices, 10, 2);
|
||||||
|
|
||||||
$resource->save();
|
$resource->save();
|
||||||
$resource->saveComposeConfigs();
|
$resource->saveComposeConfigs();
|
||||||
|
|
||||||
@@ -2842,8 +2843,10 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
|||||||
'configs' => $topLevelConfigs->toArray(),
|
'configs' => $topLevelConfigs->toArray(),
|
||||||
'secrets' => $topLevelSecrets->toArray(),
|
'secrets' => $topLevelSecrets->toArray(),
|
||||||
];
|
];
|
||||||
$resource->docker_compose_raw = Yaml::dump($yaml, 10, 2);
|
$resource->docker_compose_raw = Yaml::dump($yaml, 10, 2);
|
||||||
$resource->docker_compose = Yaml::dump($finalServices, 10, 2);
|
$resource->docker_compose = Yaml::dump($finalServices, 10, 2);
|
||||||
|
data_forget($resource, 'environment_variables');
|
||||||
|
data_forget($resource, 'environment_variables_preview');
|
||||||
$resource->save();
|
$resource->save();
|
||||||
|
|
||||||
return collect($finalServices);
|
return collect($finalServices);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex items-center justify-center gap-2 text-xs font-bold">
|
<div class="flex items-center justify-center gap-2 text-xs font-bold">
|
||||||
<a class="hover:underline"
|
<a class="hover:underline"
|
||||||
href="{{ route('project.resource.create', ['project_uuid' => $project->uuid, 'environment_name' => $project->default_environment()]) }}">
|
href="{{ route('project.resource.create', ['project_uuid' => $project->uuid, 'environment_name' => data_get($project, 'default_environment()', 'production')]) }}">
|
||||||
<span class="p-2 font-bold">+ Add Resource</span>
|
<span class="p-2 font-bold">+ Add Resource</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="hover:underline"
|
<a class="hover:underline"
|
||||||
|
|||||||
Reference in New Issue
Block a user