revert savecomposeconfig

This commit is contained in:
Andras Bacsai 2024-06-24 23:47:55 +02:00
parent 5500a1edb3
commit 8d85976ac0
4 changed files with 22 additions and 22 deletions

View File

@ -840,26 +840,26 @@ class Service extends BaseModel
$json = Yaml::parse($this->docker_compose); $json = Yaml::parse($this->docker_compose);
$envs_from_coolify = $this->environment_variables()->get(); $envs_from_coolify = $this->environment_variables()->get();
foreach ($json['services'] as $service => $config) { // foreach ($json['services'] as $service => $config) {
if (data_get($config, 'environment') === null) { // if (data_get($config, 'environment') === null) {
data_set($json, "services.$service.environment", []); // data_set($json, "services.$service.environment", []);
$envs = collect([]); // $envs = collect([]);
} else { // } else {
$envs = collect($config['environment']); // $envs = collect($config['environment']);
} // }
// $envs->put('COOLIFY_CONTAINER_NAME', "$service-{$this->uuid}"); // // $envs->put('COOLIFY_CONTAINER_NAME', "$service-{$this->uuid}");
foreach ($envs_from_coolify as $env) { // foreach ($envs_from_coolify as $env) {
$envs = $envs->map(function ($value) use ($env) { // $envs = $envs->map(function ($value) use ($env) {
if (str($value)->startsWith($env->key)) { // if (str($value)->startsWith($env->key)) {
return "{$env->key}={$env->real_value}"; // return "{$env->key}={$env->real_value}";
} // }
return $value; // return $value;
}); // });
} // }
$envs = $envs->unique(); // $envs = $envs->unique();
data_set($json, "services.$service.environment", $envs->toArray()); // data_set($json, "services.$service.environment", $envs->toArray());
} // }
$this->docker_compose = Yaml::dump($json, 10, 2, Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK); $this->docker_compose = Yaml::dump($json, 10, 2, Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK);
$docker_compose_base64 = base64_encode($this->docker_compose); $docker_compose_base64 = base64_encode($this->docker_compose);

View File

@ -7,7 +7,7 @@ return [
// The release version of your application // The release version of your application
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
'release' => '4.0.0-beta.303', 'release' => '4.0.0-beta.304',
// When left empty or `null` the Laravel environment will be used // When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'), 'environment' => config('app.env'),

View File

@ -1,3 +1,3 @@
<?php <?php
return '4.0.0-beta.303'; return '4.0.0-beta.304';

View File

@ -1,7 +1,7 @@
{ {
"coolify": { "coolify": {
"v4": { "v4": {
"version": "4.0.0-beta.303" "version": "4.0.0-beta.304"
} }
} }
} }