fix: remove SERVICE_ from deployable compose

This commit is contained in:
Andras Bacsai 2023-10-05 08:40:17 +02:00
parent 4075572dbc
commit 1c8f92d3b7

View File

@ -414,12 +414,7 @@ public function parse(bool $isNew = false): Collection
} }
$fqdn = "$fqdn$path"; $fqdn = "$fqdn$path";
} }
// } else if (substr_count($key->value(), '_') === 3) {
// if (is_null($value)) {
// $value = Str::of('/');
// }
// $path = $value->value();
// }
if (!$isDatabase) { if (!$isDatabase) {
if ($savedService->fqdn) { if ($savedService->fqdn) {
$fqdn = $savedService->fqdn . ',' . $fqdn; $fqdn = $savedService->fqdn . ',' . $fqdn;
@ -557,8 +552,10 @@ public function parse(bool $isNew = false): Collection
// Remove unnecessary variables from service.environment // Remove unnecessary variables from service.environment
$withoutServiceEnvs = collect([]); $withoutServiceEnvs = collect([]);
collect(data_get($service, 'environment'))->each(function ($value, $key) use ($withoutServiceEnvs) { collect(data_get($service, 'environment'))->each(function ($value, $key) use ($withoutServiceEnvs) {
if (!Str::of($key)->startsWith('$SERVICE_')) { if (!Str::of($key)->startsWith('$SERVICE_') && !Str::of($value)->startsWith('SERVICE_')) {
$withoutServiceEnvs->put($key, $value); $k = Str::of($value)->before("=");
$v = Str::of($value)->after("=");
$withoutServiceEnvs->put($k->value(), $v->value());
} }
}); });
data_set($service, 'environment', $withoutServiceEnvs->toArray()); data_set($service, 'environment', $withoutServiceEnvs->toArray());