From 9f06e7193e81d43c3fa4ab3f5b133b28beaa646d Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Fri, 30 May 2025 10:09:13 +0200 Subject: [PATCH] feat(previews): add force deploy without cache functionality and update deploy method to accept force rebuild parameter --- app/Livewire/Project/Application/Previews.php | 9 +++- .../project/application/previews.blade.php | 50 +++++++++++-------- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/app/Livewire/Project/Application/Previews.php b/app/Livewire/Project/Application/Previews.php index 193a22280..e89ba3257 100644 --- a/app/Livewire/Project/Application/Previews.php +++ b/app/Livewire/Project/Application/Previews.php @@ -138,13 +138,18 @@ class Previews extends Component } } + public function force_deploy_without_cache(int $pull_request_id, ?string $pull_request_html_url = null) + { + $this->deploy($pull_request_id, $pull_request_html_url, force_rebuild: true); + } + public function add_and_deploy(int $pull_request_id, ?string $pull_request_html_url = null) { $this->add($pull_request_id, $pull_request_html_url); $this->deploy($pull_request_id, $pull_request_html_url); } - public function deploy(int $pull_request_id, ?string $pull_request_html_url = null) + public function deploy(int $pull_request_id, ?string $pull_request_html_url = null, bool $force_rebuild = false) { try { $this->setDeploymentUuid(); @@ -159,7 +164,7 @@ class Previews extends Component $result = queue_application_deployment( application: $this->application, deployment_uuid: $this->deployment_uuid, - force_rebuild: false, + force_rebuild: $force_rebuild, pull_request_id: $pull_request_id, git_type: $found->git_type ?? null, ); diff --git a/resources/views/livewire/project/application/previews.blade.php b/resources/views/livewire/project/application/previews.blade.php index 876aba17a..37f7e35b5 100644 --- a/resources/views/livewire/project/application/previews.blade.php +++ b/resources/views/livewire/project/application/previews.blade.php @@ -130,6 +130,22 @@ @endif
+