refactor build server

This commit is contained in:
Andras Bacsai 2024-01-18 11:40:13 +01:00
parent e060409a76
commit 77558b37da
4 changed files with 15 additions and 10 deletions

View File

@ -67,6 +67,7 @@ class General extends Component
'application.docker_compose_custom_start_command' => 'nullable',
'application.docker_compose_custom_build_command' => 'nullable',
'application.settings.is_raw_compose_deployment_enabled' => 'boolean|required',
'application.settings.is_build_server_enabled' => 'boolean|required',
];
protected $validationAttributes = [
'application.name' => 'name',
@ -100,6 +101,7 @@ class General extends Component
'application.docker_compose_custom_start_command' => 'Docker compose custom start command',
'application.docker_compose_custom_build_command' => 'Docker compose custom build command',
'application.settings.is_raw_compose_deployment_enabled' => 'Is raw compose deployment enabled',
'application.settings.is_build_server_enabled' => 'Is build server enabled',
];
public function mount()
{

View File

@ -78,7 +78,7 @@ class Heading extends Component
return;
}
if (data_get($this->application, 'settings.is_build_server_enabled') && is_null($this->application->docker_registry_image_name)) {
$this->dispatch('error', 'To use a build server you must set a Docker image name first.<br>More information here: <a target="_blank" class="underline" href="https://coolify.io/docs/build-server">documentation</a>');
$this->dispatch('error', 'To use a build server you must set a Docker image name first.<br>More information here: <a target="_blank" class="underline" href="https://coolify.io/docs/server/build-server">documentation</a>');
return;
}
$this->setDeploymentUuid();

View File

@ -6,9 +6,6 @@
<div>Advanced configuration for your application.</div>
<div class="flex flex-col pt-4 ">
<h4>General</h4>
<x-forms.checkbox
helper="Use a build server to build your application. You can configure your build server in the Server settings. This is experimental."
instantSave id="application.settings.is_build_server_enabled" label="Use a Build Server? (experimental)" />
@if ($application->git_based())
<x-forms.checkbox helper="Automatically deploy new commits based on Git webhooks." instantSave
id="application.settings.is_auto_deploy_enabled" label="Auto Deploy" />

View File

@ -72,18 +72,20 @@
</div>
@endif
@if ($application->build_pack !== 'dockercompose')
<h3>Docker Registry</h3>
<div class="flex items-center gap-2">
<h3>Docker Registry</h3>
@if ($application->build_pack !== 'dockerimage' && !$application->destination->server->isSwarm())
<x-helper
helper='Push the built image to a docker registry. More info <a class="underline"
href="https://coolify.io/docs/docker/registry" target="_blank">here</a>' />
@endif
</div>
@if ($application->destination->server->isSwarm())
@if ($application->build_pack !== 'dockerimage')
<div>Docker Swarm requires the image to be available in a registry. More info <a
class="underline" href="https://coolify.io/docs/docker/registry"
target="_blank">here</a>.</div>
@endif
@else
@if ($application->build_pack !== 'dockerimage')
<div>Push the built image to a docker registry. More info <a class="underline"
href="https://coolify.io/docs/docker/registry" target="_blank">here</a>.</div>
@endif
@endif
<div class="flex flex-col gap-2 xl:flex-row">
@if ($application->build_pack === 'dockerimage')
@ -160,6 +162,10 @@
</div>
</div>
@else
<x-forms.checkbox
helper="Use a build server to build your application. You can configure your build server in the Server settings. This is experimental. For more info, check the <a href='https://coolify.io/docs/server/build-server' class='underline' target='_blank'>documentation</a>."
instantSave id="application.settings.is_build_server_enabled"
label="Use a Build Server? (experimental)" />
<div class="flex flex-col gap-2 xl:flex-row">
<x-forms.input placeholder="/" id="application.base_directory" label="Base Directory"
helper="Directory to use as root. Useful for monorepos." />