From 320204d85412f0c03f0f3f25ef4bd2a2180d1e01 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 22 Jul 2024 15:10:07 +0200 Subject: [PATCH] fix: directory will be created by default for compose host mounts --- bootstrap/helpers/services.php | 7 +++++++ bootstrap/helpers/shared.php | 1 + .../livewire/project/application/configuration.blade.php | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bootstrap/helpers/services.php b/bootstrap/helpers/services.php index 7769b7217..c33b7eb34 100644 --- a/bootstrap/helpers/services.php +++ b/bootstrap/helpers/services.php @@ -73,6 +73,13 @@ function getFilesystemVolumesFromServer(ServiceApplication|ServiceDatabase|Appli "echo '$content' | base64 -d | tee $fileLocation", ], $server); } elseif ($isFile == 'NOK' && $isDir == 'NOK' && $fileVolume->is_directory && $isInit) { + // Does not exists (no dir or file), flagged as directory, is init + $fileVolume->content = null; + $fileVolume->is_directory = true; + $fileVolume->save(); + instant_remote_process(["mkdir -p $fileLocation"], $server); + } elseif ($isFile == 'NOK' && $isDir == 'NOK' && ! $fileVolume->is_directory && $isInit && ! $content) { + // Does not exists (no dir or file), not flagged as directory, is init, has no content => create directory $fileVolume->content = null; $fileVolume->is_directory = true; $fileVolume->save(); diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index e3c8d5218..7ae2b0309 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -1735,6 +1735,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal if (is_array($volume)) { return data_get($volume, 'source'); } + dispatch(new ServerFilesFromServerJob($resource)); return $volume->value(); }); diff --git a/resources/views/livewire/project/application/configuration.blade.php b/resources/views/livewire/project/application/configuration.blade.php index feb8c5679..ada74260f 100644 --- a/resources/views/livewire/project/application/configuration.blade.php +++ b/resources/views/livewire/project/application/configuration.blade.php @@ -106,7 +106,7 @@
- +