refactor: Update Docker Compose location handling in PublicGitRepository

This commit is contained in:
Andras Bacsai 2024-09-04 14:09:55 +02:00
parent 5799e6d8b0
commit a3a61dbe55
2 changed files with 12 additions and 2 deletions

View File

@ -99,6 +99,16 @@ public function updatedBaseDirectory()
} }
} }
public function updatedDockerComposeLocation()
{
if ($this->docker_compose_location) {
$this->docker_compose_location = rtrim($this->docker_compose_location, '/');
if (! str($this->docker_compose_location)->startsWith('/')) {
$this->docker_compose_location = '/'.$this->docker_compose_location;
}
}
}
public function updatedBuildPack() public function updatedBuildPack()
{ {
if ($this->build_pack === 'nixpacks') { if ($this->build_pack === 'nixpacks') {

View File

@ -4,7 +4,7 @@
<form class="flex flex-col gap-2" wire:submit='loadBranch'> <form class="flex flex-col gap-2" wire:submit='loadBranch'>
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<div class="flex items-end gap-2"> <div class="flex gap-2 items-end">
<x-forms.input required id="repository_url" label="Repository URL (https://)" <x-forms.input required id="repository_url" label="Repository URL (https://)"
helper="{!! __('repository.url') !!}" /> helper="{!! __('repository.url') !!}" />
<x-forms.button type="submit"> <x-forms.button type="submit">
@ -47,7 +47,7 @@
@if ($build_pack === 'dockercompose') @if ($build_pack === 'dockercompose')
<x-forms.input placeholder="/" wire:model.blur="base_directory" label="Base Directory" <x-forms.input placeholder="/" wire:model.blur="base_directory" label="Base Directory"
helper="Directory to use as root. Useful for monorepos." /> helper="Directory to use as root. Useful for monorepos." />
<x-forms.input placeholder="/docker-compose.yaml" id="docker_compose_location" <x-forms.input placeholder="/docker-compose.yaml" wire:model.blur="docker_compose_location"
label="Docker Compose Location" label="Docker Compose Location"
helper="It is calculated together with the Base Directory:<br><span class='dark:text-warning'>{{ Str::start($base_directory . $docker_compose_location, '/') }}</span>" /> helper="It is calculated together with the Base Directory:<br><span class='dark:text-warning'>{{ Str::start($base_directory . $docker_compose_location, '/') }}</span>" />
Compose file location in your repository:<span Compose file location in your repository:<span