diff --git a/app/Livewire/Project/Service/EditCompose.php b/app/Livewire/Project/Service/EditCompose.php index 3d0ad4e0b..dc043e65a 100644 --- a/app/Livewire/Project/Service/EditCompose.php +++ b/app/Livewire/Project/Service/EditCompose.php @@ -43,6 +43,7 @@ public function saveEditedCompose() { $this->dispatch('info', 'Saving new docker compose...'); $this->dispatch('saveCompose', $this->service->docker_compose_raw); + $this->dispatch('refreshStorages'); } public function instantSave() diff --git a/app/Livewire/Project/Shared/EnvironmentVariable/All.php b/app/Livewire/Project/Shared/EnvironmentVariable/All.php index 4c79eb3a2..055788b57 100644 --- a/app/Livewire/Project/Shared/EnvironmentVariable/All.php +++ b/app/Livewire/Project/Shared/EnvironmentVariable/All.php @@ -24,6 +24,7 @@ class All extends Component protected $listeners = [ 'saveKey' => 'submit', + 'refreshEnvs', 'environmentVariableDeleted' => 'refreshEnvs', ]; @@ -61,7 +62,7 @@ public function sortEnvironmentVariables() $sortBy = data_get($this->resource, 'settings.is_env_sorting_enabled') ? 'key' : 'order'; $sortFunction = function ($variables) use ($sortBy) { - if (!$variables) { + if (! $variables) { return $variables; } if ($sortBy === 'key') { diff --git a/app/Livewire/Project/Shared/EnvironmentVariable/Show.php b/app/Livewire/Project/Shared/EnvironmentVariable/Show.php index cbc4314f0..463ceecad 100644 --- a/app/Livewire/Project/Shared/EnvironmentVariable/Show.php +++ b/app/Livewire/Project/Shared/EnvironmentVariable/Show.php @@ -136,4 +136,4 @@ public function delete() return handleError($e); } } -} \ No newline at end of file +} diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index b34d9f174..cc5c13407 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -3331,7 +3331,10 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int foreach ($normalEnvironments as $key => $value) { $key = str($key); $value = str($value); - if ($value->startsWith('$')) { + if ($value->startsWith('$') || $value->contains('${')) { + if ($value->contains('${')) { + $value = $value->after('${')->before('}'); + } $value = str(replaceVariables(str($value))); if ($value->contains(':-')) { $key = $value->before(':');