Add build pack selection and update related fields
This commit is contained in:
@@ -39,6 +39,8 @@ class GithubPrivateRepository extends Component
|
|||||||
public bool $is_static = false;
|
public bool $is_static = false;
|
||||||
public string|null $publish_directory = null;
|
public string|null $publish_directory = null;
|
||||||
protected int $page = 1;
|
protected int $page = 1;
|
||||||
|
public $build_pack = 'nixpacks';
|
||||||
|
public bool $show_is_static = true;
|
||||||
|
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
@@ -49,6 +51,20 @@ class GithubPrivateRepository extends Component
|
|||||||
$this->repositories = $this->branches = collect();
|
$this->repositories = $this->branches = collect();
|
||||||
$this->github_apps = GithubApp::private();
|
$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)
|
public function loadRepositories($github_app_id)
|
||||||
{
|
{
|
||||||
$this->repositories = collect();
|
$this->repositories = collect();
|
||||||
|
@@ -29,12 +29,17 @@ class GithubPrivateRepositoryDeployKey extends Component
|
|||||||
|
|
||||||
public string $repository_url;
|
public string $repository_url;
|
||||||
public string $branch;
|
public string $branch;
|
||||||
|
|
||||||
|
public $build_pack = 'nixpacks';
|
||||||
|
public bool $show_is_static = true;
|
||||||
|
|
||||||
protected $rules = [
|
protected $rules = [
|
||||||
'repository_url' => 'required',
|
'repository_url' => 'required',
|
||||||
'branch' => 'required|string',
|
'branch' => 'required|string',
|
||||||
'port' => 'required|numeric',
|
'port' => 'required|numeric',
|
||||||
'is_static' => 'required|boolean',
|
'is_static' => 'required|boolean',
|
||||||
'publish_directory' => 'nullable|string',
|
'publish_directory' => 'nullable|string',
|
||||||
|
'build_pack' => 'required|string',
|
||||||
];
|
];
|
||||||
protected $validationAttributes = [
|
protected $validationAttributes = [
|
||||||
'repository_url' => 'Repository',
|
'repository_url' => 'Repository',
|
||||||
@@ -42,6 +47,7 @@ class GithubPrivateRepositoryDeployKey extends Component
|
|||||||
'port' => 'Port',
|
'port' => 'Port',
|
||||||
'is_static' => 'Is static',
|
'is_static' => 'Is static',
|
||||||
'publish_directory' => 'Publish directory',
|
'publish_directory' => 'Publish directory',
|
||||||
|
'build_pack' => 'Build pack',
|
||||||
];
|
];
|
||||||
private object $repository_url_parsed;
|
private object $repository_url_parsed;
|
||||||
private GithubApp|GitlabApp|string $git_source = 'other';
|
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()
|
public function instantSave()
|
||||||
{
|
{
|
||||||
if ($this->is_static) {
|
if ($this->is_static) {
|
||||||
|
@@ -40,23 +40,29 @@
|
|||||||
<li class="step step-secondary">Select a Private Key</li>
|
<li class="step step-secondary">Select a Private Key</li>
|
||||||
<li class="step step-secondary">Select a Repository, Branch & Save</li>
|
<li class="step step-secondary">Select a Repository, Branch & Save</li>
|
||||||
</ul>
|
</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">
|
<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.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)
|
@if ($is_static)
|
||||||
<x-forms.input id="publish_directory" required label="Publish Directory" />
|
<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
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div class="w-52">
|
<x-forms.input type="number" required id="port" label="Port" :readonly="$is_static || $build_pack === 'static'" />
|
||||||
<x-forms.checkbox instantSave id="is_static" label="Is it a static site?"
|
@if ($show_is_static)
|
||||||
helper="If your application is a static site or the final build assets should be served as a static site, enable this." />
|
<div class="w-52">
|
||||||
</div>
|
<x-forms.checkbox instantSave id="is_static" label="Is it a static site?"
|
||||||
<x-forms.button type="submit">
|
helper="If your application is a static site or the final build assets should be served as a static site, enable this." />
|
||||||
Save New Application
|
</div>
|
||||||
|
@endif
|
||||||
|
<x-forms.button type="submit" class="mt-4">
|
||||||
|
Continue
|
||||||
</x-forms.button>
|
</x-forms.button>
|
||||||
</form>
|
</form>
|
||||||
@endif
|
@endif
|
||||||
|
@@ -4,8 +4,16 @@
|
|||||||
<x-forms.button wire:click="saveFromRedirect('source.new')" class="group-hover:text-white">
|
<x-forms.button wire:click="saveFromRedirect('source.new')" class="group-hover:text-white">
|
||||||
+ Add New GitHub App
|
+ Add New GitHub App
|
||||||
</x-forms.button>
|
</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>
|
||||||
<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)
|
@if ($github_apps->count() !== 0)
|
||||||
<div class="flex flex-col gap-2 pt-10">
|
<div class="flex flex-col gap-2 pt-10">
|
||||||
@if ($current_step === 'github_apps')
|
@if ($current_step === 'github_apps')
|
||||||
@@ -53,14 +61,8 @@
|
|||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
</x-forms.select>
|
</x-forms.select>
|
||||||
<x-forms.button wire:click.prevent="loadBranches"> Load Repository Details </x-forms.button>
|
<x-forms.button wire:click.prevent="loadBranches"> Load Repository </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>
|
|
||||||
</div>
|
</div>
|
||||||
@else
|
@else
|
||||||
<div>No repositories found. Check your GitHub App configuration.</div>
|
<div>No repositories found. Check your GitHub App configuration.</div>
|
||||||
@@ -84,21 +86,28 @@
|
|||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
</x-forms.select>
|
</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)
|
@if ($is_static)
|
||||||
<x-forms.input id="publish_directory" label="Publish Directory"
|
<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." />
|
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
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div class="w-52">
|
<x-forms.input type="number" id="port" label="Port" :readonly="$is_static || $build_pack === 'static'"
|
||||||
<x-forms.checkbox instantSave id="is_static" label="Is it a static site?"
|
helper="The port your application listens on." />
|
||||||
helper="If your application is a static site or the final build assets should be served as a static site, enable this." />
|
@if ($show_is_static)
|
||||||
</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>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<x-forms.button type="submit">
|
<x-forms.button type="submit">
|
||||||
Save New Application
|
Continue
|
||||||
</x-forms.button>
|
</x-forms.button>
|
||||||
@endif
|
@endif
|
||||||
@endif
|
@endif
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
</x-forms.button>
|
</x-forms.button>
|
||||||
</div>
|
</div>
|
||||||
@if (!$branch_found)
|
@if (!$branch_found)
|
||||||
<div>
|
<div class="px-2 pt-4">
|
||||||
<p>Public repositories: <span class='text-helper'>https://...</span></p>
|
<p>Public repositories: <span class='text-helper'>https://...</span></p>
|
||||||
<p>Private repositories: <span class='text-helper'>git@...</span></p>
|
<p>Private repositories: <span class='text-helper'>git@...</span></p>
|
||||||
<p>Preselect branch: <span
|
<p>Preselect branch: <span
|
||||||
@@ -42,15 +42,14 @@
|
|||||||
<option value="dockerfile">Dockerfile</option>
|
<option value="dockerfile">Dockerfile</option>
|
||||||
<option value="dockercompose">Docker Compose</option>
|
<option value="dockercompose">Docker Compose</option>
|
||||||
</x-forms.select>
|
</x-forms.select>
|
||||||
</div>
|
|
||||||
@if ($show_is_static)
|
|
||||||
@if ($is_static)
|
@if ($is_static)
|
||||||
<x-forms.input id="publish_directory" label="Publish Directory"
|
<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." />
|
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
|
@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">
|
<div class="w-52">
|
||||||
<x-forms.checkbox instantSave id="is_static" label="Is it a static site?"
|
<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." />
|
helper="If your application is a static site or the final build assets should be served as a static site, enable this." />
|
||||||
|
Reference in New Issue
Block a user