From 1c8f92d3b7625bd76cafe0d49a75615bb4c06bcc Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 5 Oct 2023 08:40:17 +0200 Subject: [PATCH] fix: remove SERVICE_ from deployable compose --- app/Models/Service.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/Models/Service.php b/app/Models/Service.php index 8f4e3a72a..13b7173c1 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -414,12 +414,7 @@ public function parse(bool $isNew = false): Collection } $fqdn = "$fqdn$path"; } - // } else if (substr_count($key->value(), '_') === 3) { - // if (is_null($value)) { - // $value = Str::of('/'); - // } - // $path = $value->value(); - // } + if (!$isDatabase) { if ($savedService->fqdn) { $fqdn = $savedService->fqdn . ',' . $fqdn; @@ -557,8 +552,10 @@ public function parse(bool $isNew = false): Collection // Remove unnecessary variables from service.environment $withoutServiceEnvs = collect([]); collect(data_get($service, 'environment'))->each(function ($value, $key) use ($withoutServiceEnvs) { - if (!Str::of($key)->startsWith('$SERVICE_')) { - $withoutServiceEnvs->put($key, $value); + if (!Str::of($key)->startsWith('$SERVICE_') && !Str::of($value)->startsWith('SERVICE_')) { + $k = Str::of($value)->before("="); + $v = Str::of($value)->after("="); + $withoutServiceEnvs->put($k->value(), $v->value()); } }); data_set($service, 'environment', $withoutServiceEnvs->toArray());