Skip to content

Commit

Permalink
revert savecomposeconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasbacsai committed Jun 24, 2024
1 parent 5500a1e commit 8d85976
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
40 changes: 20 additions & 20 deletions app/Models/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -840,26 +840,26 @@ public function saveComposeConfigs()

$json = Yaml::parse($this->docker_compose);
$envs_from_coolify = $this->environment_variables()->get();
foreach ($json['services'] as $service => $config) {
if (data_get($config, 'environment') === null) {
data_set($json, "services.$service.environment", []);
$envs = collect([]);
} else {
$envs = collect($config['environment']);
}
// $envs->put('COOLIFY_CONTAINER_NAME', "$service-{$this->uuid}");
foreach ($envs_from_coolify as $env) {
$envs = $envs->map(function ($value) use ($env) {
if (str($value)->startsWith($env->key)) {
return "{$env->key}={$env->real_value}";
}

return $value;
});
}
$envs = $envs->unique();
data_set($json, "services.$service.environment", $envs->toArray());
}
// foreach ($json['services'] as $service => $config) {
// if (data_get($config, 'environment') === null) {
// data_set($json, "services.$service.environment", []);
// $envs = collect([]);
// } else {
// $envs = collect($config['environment']);
// }
// // $envs->put('COOLIFY_CONTAINER_NAME', "$service-{$this->uuid}");
// foreach ($envs_from_coolify as $env) {
// $envs = $envs->map(function ($value) use ($env) {
// if (str($value)->startsWith($env->key)) {
// return "{$env->key}={$env->real_value}";
// }

// return $value;
// });
// }
// $envs = $envs->unique();
// data_set($json, "services.$service.environment", $envs->toArray());
// }
$this->docker_compose = Yaml::dump($json, 10, 2, Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK);
$docker_compose_base64 = base64_encode($this->docker_compose);

Expand Down
2 changes: 1 addition & 1 deletion config/sentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// The release version of your application
// 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
'environment' => config('app.env'),

Expand Down
2 changes: 1 addition & 1 deletion config/version.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

return '4.0.0-beta.303';
return '4.0.0-beta.304';
2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"coolify": {
"v4": {
"version": "4.0.0-beta.303"
"version": "4.0.0-beta.304"
}
}
}

0 comments on commit 8d85976

Please sign in to comment.