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
Add build pack selection and update related fields
Andras Bacsai39647367a5bd
diff --git a/app/Livewire/Project/New/GithubPrivateRepository.php b/app/Livewire/Project/New/GithubPrivateRepository.phpindex 9ae9aeb574..012325ff15 100644--- a/app/Livewire/Project/New/GithubPrivateRepository.php+++ b/app/Livewire/Project/New/GithubPrivateRepository.php@@ -39,6 +39,8 @@ class GithubPrivateRepository extends Componentpublic bool $is_static = false;public string|null $publish_directory = null;protected int $page = 1;+ public $build_pack = 'nixpacks';+ public bool $show_is_static = true;public function mount()@@ -49,6 +51,20 @@ class GithubPrivateRepository extends Component$this->repositories = $this->branches = collect();$this->github_apps = GithubApp::private();}+ public function updatedBuildPack()+ {+ if ($this->build_pack === 'nixpacks') {+ $this->show_is_static = true;+ $this->port = 3000;+ } else if ($this->build_pack === 'static') {+ $this->show_is_static = false;+ $this->is_static = false;+ $this->port = 80;+ } else {+ $this->show_is_static = false;+ $this->is_static = false;+ }+ }public function loadRepositories($github_app_id){$this->repositories = collect();diff --git a/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php b/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.phpindex ba403ca1c1..723d4bb601 100644--- a/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php+++ b/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php@@ -29,12 +29,17 @@ class GithubPrivateRepositoryDeployKey extends Componentpublic string $repository_url;public string $branch;++ public $build_pack = 'nixpacks';+ public bool $show_is_static = true;+protected $rules = ['repository_url' => 'required','branch' => 'required|string','port' => 'required|numeric','is_static' => 'required|boolean','publish_directory' => 'nullable|string',+ 'build_pack' => 'required|string',];protected $validationAttributes = ['repository_url' => 'Repository',@@ -42,6 +47,7 @@ class GithubPrivateRepositoryDeployKey extends Component'port' => 'Port','is_static' => 'Is static','publish_directory' => 'Publish directory',+ 'build_pack' => 'Build pack',];private object $repository_url_parsed;private GithubApp|GitlabApp|string $git_source = 'other';@@ -62,6 +68,20 @@ class GithubPrivateRepositoryDeployKey extends Component}}+ public function updatedBuildPack()+ {+ if ($this->build_pack === 'nixpacks') {+ $this->show_is_static = true;+ $this->port = 3000;+ } else if ($this->build_pack === 'static') {+ $this->show_is_static = false;+ $this->is_static = false;+ $this->port = 80;+ } else {+ $this->show_is_static = false;+ $this->is_static = false;+ }+ }public function instantSave(){if ($this->is_static) {diff --git a/resources/views/livewire/project/new/github-private-repository-deploy-key.blade.php b/resources/views/livewire/project/new/github-private-repository-deploy-key.blade.phpindex f7fe57ac2a..ed18da4849 100644--- a/resources/views/livewire/project/new/github-private-repository-deploy-key.blade.php+++ b/resources/views/livewire/project/new/github-private-repository-deploy-key.blade.php@@ -40,23 +40,29 @@<li class="step step-secondary">Select a Private Key</li><li class="step step-secondary">Select a Repository, Branch & Save</li></ul>- <form class="flex flex-col gap-2 pb-6" wire:submit='submit'>+ <form class="flex flex-col gap-2 pt-2" wire:submit='submit'>+ <x-forms.input id="repository_url" required label="Repository Url" helper="{!! __('repository.url') !!}" /><div class="flex gap-2">- <x-forms.input id="repository_url" required label="Repository URL"- helper="{!! __('repository.url') !!}" /><x-forms.input id="branch" required label="Branch" />+ <x-forms.select wire:model.live="build_pack" label="Build Pack" required>+ <option value="nixpacks">Nixpacks</option>+ <option value="static">Static</option>+ <option value="dockerfile">Dockerfile</option>+ <option value="dockercompose">Docker Compose</option>+ </x-forms.select>@if ($is_static)<x-forms.input id="publish_directory" required label="Publish Directory" />- @else- <x-forms.input type="number" required id="port" label="Port" :readonly="$is_static" />@endif</div>- <div class="w-52">- <x-forms.checkbox instantSave id="is_static" label="Is it a static site?"- helper="If your application is a static site or the final build assets should be served as a static site, enable this." />- </div>- <x-forms.button type="submit">- Save New Application+ <x-forms.input type="number" required id="port" label="Port" :readonly="$is_static || $build_pack === 'static'" />+ @if ($show_is_static)+ <div class="w-52">+ <x-forms.checkbox instantSave id="is_static" label="Is it a static site?"+ helper="If your application is a static site or the final build assets should be served as a static site, enable this." />+ </div>+ @endif+ <x-forms.button type="submit" class="mt-4">+ Continue</x-forms.button></form>@endifdiff --git a/resources/views/livewire/project/new/github-private-repository.blade.php b/resources/views/livewire/project/new/github-private-repository.blade.phpindex 082decd22e..d20f24bc7f 100644--- a/resources/views/livewire/project/new/github-private-repository.blade.php+++ b/resources/views/livewire/project/new/github-private-repository.blade.php@@ -4,8 +4,16 @@<x-forms.button wire:click="saveFromRedirect('source.new')" class="group-hover:text-white">+ Add New GitHub App</x-forms.button>+ @if ($repositories->count() > 0)+ <a target="_blank" class="flex hover:no-underline" href="{{ get_installation_path($github_app) }}">+ <x-forms.button>+ Change Repositories on GitHub+ <x-external-link />+ </x-forms.button>+ </a>+ @endif</div>- <div class="pb-4">Deploy any public or private git repositories through a GitHub App.</div>+ <div class="pb-4">Deploy any public or private Git repositories through a GitHub App.</div>@if ($github_apps->count() !== 0)<div class="flex flex-col gap-2 pt-10">@if ($current_step === 'github_apps')@@ -53,14 +61,8 @@@endif@endforeach</x-forms.select>- <x-forms.button wire:click.prevent="loadBranches"> Load Repository Details </x-forms.button>- <a target="_blank" class="flex hover:no-underline"- href="{{ get_installation_path($github_app) }}">- <x-forms.button>- Change Repositories on GitHub- <x-external-link />- </x-forms.button>- </a>+ <x-forms.button wire:click.prevent="loadBranches"> Load Repository </x-forms.button>+</div>@else<div>No repositories found. Check your GitHub App configuration.</div>@@ -84,21 +86,28 @@@endif@endforeach</x-forms.select>+ <x-forms.select wire:model.live="build_pack" label="Build Pack" required>+ <option value="nixpacks">Nixpacks</option>+ <option value="static">Static</option>+ <option value="dockerfile">Dockerfile</option>+ <option value="dockercompose">Docker Compose</option>+ </x-forms.select>@if ($is_static)<x-forms.input id="publish_directory" label="Publish Directory"helper="If there is a build process involved (like Svelte, React, Next, etc..), please specify the output directory for the build assets." />- @else- <x-forms.input type="number" id="port" label="Port" :readonly="$is_static"- helper="The port your application listens on." />@endif</div>- <div class="w-52">- <x-forms.checkbox instantSave id="is_static" label="Is it a static site?"- helper="If your application is a static site or the final build assets should be served as a static site, enable this." />- </div>+ <x-forms.input type="number" id="port" label="Port" :readonly="$is_static || $build_pack === 'static'"+ helper="The port your application listens on." />+ @if ($show_is_static)+ <div class="w-52">+ <x-forms.checkbox instantSave id="is_static" label="Is it a static site?"+ helper="If your application is a static site or the final build assets should be served as a static site, enable this." />+ </div>+ @endif</div><x-forms.button type="submit">- Save New Application+ Continue</x-forms.button>@endif@endifdiff --git a/resources/views/livewire/project/new/public-git-repository.blade.php b/resources/views/livewire/project/new/public-git-repository.blade.phpindex 5efeaa3922..c01cbc9c96 100644--- a/resources/views/livewire/project/new/public-git-repository.blade.php+++ b/resources/views/livewire/project/new/public-git-repository.blade.php@@ -11,7 +11,7 @@</x-forms.button></div>@if (!$branch_found)- <div>+ <div class="px-2 pt-4"><p>Public repositories: <span class='text-helper'>https://...</span></p><p>Private repositories: <span class='text-helper'>git@...</span></p><p>Preselect branch: <span@@ -42,15 +42,14 @@<option value="dockerfile">Dockerfile</option><option value="dockercompose">Docker Compose</option></x-forms.select>- </div>- @if ($show_is_static)@if ($is_static)<x-forms.input id="publish_directory" label="Publish Directory"helper="If there is a build process involved (like Svelte, React, Next, etc..), please specify the output directory for the build assets." />- @else- <x-forms.input type="number" id="port" label="Port" :readonly="$is_static"- helper="The port your application listens on." />@endif+ </div>+ <x-forms.input type="number" id="port" label="Port" :readonly="$is_static || $build_pack === 'static'"+ helper="The port your application listens on." />+ @if ($show_is_static)<div class="w-52"><x-forms.checkbox instantSave id="is_static" label="Is it a static site?"helper="If your application is a static site or the final build assets should be served as a static site, enable this." />