Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix

Andras Bacsai3d4e985aa6f0
diff --git a/app/Http/Livewire/Project/Application/Previews.php b/app/Http/Livewire/Project/Application/Previews.php
index f56ce2f66b..cb908ff2a3 100644
--- a/app/Http/Livewire/Project/Application/Previews.php
+++ b/app/Http/Livewire/Project/Application/Previews.php
@@ -69,11 +69,11 @@ class Previews extends Component
ray('Stopping container: ' . $container_name);
instant_remote_process(["docker rm -f $container_name"], $this->application->destination->server, throwError: false);
- dispatch(new ContainerStatusJob(
- application: $this->application,
- container_name: $container_name,
- pull_request_id: $pull_request_id
- ));
+ $found = ApplicationPreview::where('application_id', $this->application->id)->where('pull_request_id', $pull_request_id)->first();
+ if ($found) {
+ $found->delete();
+ }
+ $this->application->refresh();
} catch (\Throwable $th) {
return general_error_handler($th, $this);
}
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php
index 994f612214..1d4a077c2d 100644
--- a/app/Jobs/ApplicationDeploymentJob.php
+++ b/app/Jobs/ApplicationDeploymentJob.php
@@ -594,7 +594,7 @@ COPY --from=$this->build_image_name /app/{$this->application->publish_directory}
$commands = [$this->execute_in_builder($git_clone_command)];
if ($this->pull_request_id) {
- $commands[] = $this->execute_in_builder("cd {$this->workdir} && git fetch origin pull/{$this->pull_request_id}/head:$pr_branch_name && git checkout $pr_branch_name");
+ $commands[] = $this->execute_in_builder("cd {$this->workdir} && git fetch origin pull/{$this->pull_request_id}/head:$pr_branch_name >/dev/null 2>&1 && git checkout $pr_branch_name >/dev/null 2>&1");
}
return $commands;
} else {