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.

path deployments

Andras Bacsai8651d02651b2
diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php
index b0c6680d96..6ccca47934 100644
--- a/app/Http/Controllers/ProjectController.php
+++ b/app/Http/Controllers/ProjectController.php
@@ -46,6 +46,9 @@ class ProjectController extends Controller
if (!$environment) {
return redirect()->route('dashboard');
}
- return view('project.resources', ['project' => $project, 'environment' => $environment]);
+ return view('project.resources', [
+ 'project' => $project,
+ 'environment' => $environment
+ ]);
}
}
diff --git a/app/Http/Livewire/Project/Application/General.php b/app/Http/Livewire/Project/Application/General.php
index 0b551e55f2..b9b14cb187 100644
--- a/app/Http/Livewire/Project/Application/General.php
+++ b/app/Http/Livewire/Project/Application/General.php
@@ -73,7 +73,11 @@ class General extends Component
}
public function submit()
{
- $this->validate();
- $this->application->save();
+ try {
+ $this->validate();
+ $this->application->save();
+ } catch (\Exception $e) {
+ return generalErrorHandler($e, $this);
+ }
}
}
diff --git a/app/Jobs/DeployApplicationJob.php b/app/Jobs/DeployApplicationJob.php
index 1b8dce6125..243101863f 100644
--- a/app/Jobs/DeployApplicationJob.php
+++ b/app/Jobs/DeployApplicationJob.php
@@ -383,9 +383,11 @@ COPY --from={$this->application->uuid}:{$this->git_commit}-build /app/{$this->ap
$path = $url->getPath();
$labels[] = 'traefik.enable=true';
if ($path === '/') {
- $labels[] = "traefik.http.routers.container.rule=Host(`{$host}`) && PathPrefix(`{$path}`)";
+ $labels[] = "traefik.http.routers.{$this->application->uuid}.rule=Host(`{$host}`) && Path(`{$path}`)";
} else {
- $labels[] = "traefik.http.routers.container.rule=Host(`{$host}`) && PathPrefix(`{$path}`)";
+ $labels[] = "traefik.http.routers.{$this->application->uuid}.rule=Host(`{$host}`) && PathPrefix(`{$path}`)";
+ $labels[] = "traefik.http.routers.{$this->application->uuid}.middlewares={$this->application->uuid}-stripprefix";
+ $labels[] = "traefik.http.middlewares.{$this->application->uuid}-stripprefix.stripprefix.prefixes={$path}";
}
}
return $labels;
diff --git a/bootstrap/helpers.php b/bootstrap/helpers.php
index 5d26fc05ba..9067a3dd43 100644
--- a/bootstrap/helpers.php
+++ b/bootstrap/helpers.php
@@ -33,7 +33,7 @@ if (!function_exists('generalErrorHandler')) {
}
} catch (\Throwable $error) {
if ($that) {
- $that->emit('error', $error->getMessage());
+ return $that->emit('error', $error->getMessage());
} elseif ($isJson) {
return response()->json([
'code' => $error->getCode(),
diff --git a/resources/views/project/resources.blade.php b/resources/views/project/resources.blade.php
index f30907103a..0df8ac7a62 100644
--- a/resources/views/project/resources.blade.php
+++ b/resources/views/project/resources.blade.php
@@ -6,8 +6,8 @@
@if ($environment->applications->count() === 0)
<p>No resources yet.</p>
@endif
- <div class="flex">
- @foreach ($environment->applications as $application)
+ <div class="flex gap-2">
+ @foreach ($environment->applications->sortBy('name') as $application)
<a class="box"
href="{{ route('project.application.configuration', [$project->uuid, $environment->name, $application->uuid]) }}">
{{ $application->name }}