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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: deleting application should delete preview deployments
Andras Bacsai0d8cc19698f7
diff --git a/app/Actions/Application/StopApplication.php b/app/Actions/Application/StopApplication.phpindex a812b0c6c3..1f05e29ac7 100644--- a/app/Actions/Application/StopApplication.php+++ b/app/Actions/Application/StopApplication.php@@ -9,7 +9,7 @@ class StopApplication{use AsAction;- public function handle(Application $application)+ public function handle(Application $application, bool $previewDeployments = false){if ($application->destination->server->isSwarm()) {instant_remote_process(["docker stack rm {$application->uuid}"], $application->destination->server);@@ -26,7 +26,12 @@ class StopApplicationif (! $server->isFunctional()) {return 'Server is not functional';}- $containers = getCurrentApplicationContainerStatus($server, $application->id, 0);+ if ($previewDeployments) {+ $containers = getCurrentApplicationContainerStatus($server, $application->id, includePullrequests: true);+ } else {+ $containers = getCurrentApplicationContainerStatus($server, $application->id, 0);+ }+ ray($containers);if ($containers->count() > 0) {foreach ($containers as $container) {$containerName = data_get($container, 'Names');diff --git a/app/Jobs/DeleteResourceJob.php b/app/Jobs/DeleteResourceJob.phpindex 68663f3a2f..dbf44dd5d6 100644--- a/app/Jobs/DeleteResourceJob.php+++ b/app/Jobs/DeleteResourceJob.php@@ -40,7 +40,7 @@ class DeleteResourceJob implements ShouldBeEncrypted, ShouldQueueswitch ($this->resource->type()) {case 'application':$persistentStorages = $this->resource?->persistentStorages()?->get();- StopApplication::run($this->resource);+ StopApplication::run($this->resource, previewDeployments: true);break;case 'standalone-postgresql':case 'standalone-redis':