refactor: Update Service model's saveComposeConfigs method
This commit is contained in:
parent
f6708f6e47
commit
c3fb126a0a
@ -81,7 +81,6 @@ class StackForm extends Component
|
|||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
} finally {
|
} finally {
|
||||||
if (is_null($this->service->config_hash)) {
|
if (is_null($this->service->config_hash)) {
|
||||||
ray('asdf');
|
|
||||||
$this->service->isConfigurationChanged(true);
|
$this->service->isConfigurationChanged(true);
|
||||||
} else {
|
} else {
|
||||||
$this->dispatch('configurationChanged');
|
$this->dispatch('configurationChanged');
|
||||||
|
@ -842,7 +842,7 @@ class Service extends BaseModel
|
|||||||
$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) {
|
||||||
$envs = collect($config['environment']);
|
$envs = collect($config['environment']);
|
||||||
$envs->push("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)) {
|
||||||
@ -855,7 +855,6 @@ class Service extends BaseModel
|
|||||||
$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);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user