feat: push locally built image to docker registry

ui: fixes here and there
This commit is contained in:
Andras Bacsai
2023-11-20 13:49:10 +01:00
parent e33fec0e1a
commit f88e3c5b29
9 changed files with 152 additions and 68 deletions

View File

@@ -48,9 +48,8 @@
@foreach (decode_remote_command_output($application_deployment_queue) as $line)
<div @class([
'font-mono whitespace-pre-line',
'text-white' => $line['type'] == 'stdout',
'text-error' => $line['type'] == 'stderr',
'text-warning' => $line['hidden'],
'text-error' => $line['type'] == 'stderr',
])>[{{ $line['timestamp'] }}] @if ($line['hidden'])
<br>COMMAND: <br>{{ $line['command'] }} <br><br>OUTPUT:
@endif{{ $line['output'] }}@if ($line['hidden'])

View File

@@ -40,12 +40,33 @@
</div>
@if ($application->could_set_build_commands())
<div class="w-64">
<x-forms.checkbox instantSave id="application.settings.is_static" label="Is it a static site?"
<x-forms.checkbox instantSave id="application.settings.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>
@endif
<h3>Docker Registry</h3>
@if ($application->build_pack !== 'dockerimage')
<div>Push the built image to a docker registry. More info <a class="underline"
href="https://coolify.io/docs/" target="_blank">here</a>.</div>
@endif
<div class="flex flex-col gap-2 xl:flex-row">
@if ($application->build_pack === 'dockerimage')
<x-forms.input id="application.docker_registry_image_name" label="Docker Image" />
<x-forms.input id="application.docker_registry_image_tag" label="Docker Image Tag" />
@else
<x-forms.input id="application.docker_registry_image_name"
helper="Empty means it won't push the image to a docker registry."
placeholder="Empty means it won't push the image to a docker registry." label="Docker Image" />
<x-forms.input id="application.docker_registry_image_tag"
placeholder="Empty means only push commit sha tag."
helper="If set, it will tag the built image with this tag too. <br><br>Example: If you set it to 'latest', it will push the image with the commit sha tag + with the latest tag."
label="Docker Image Tag" />
@endif
</div>
@if ($application->build_pack !== 'dockerimage')
<h3>Build</h3>
@@ -64,8 +85,6 @@
</div>
@endif
@endif
<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." />
@@ -88,11 +107,6 @@
@endif
@endif
</div>
@else
<div class="flex flex-col gap-2 xl:flex-row">
<x-forms.input id="application.docker_registry_image_name" label="Docker Image" />
<x-forms.input id="application.docker_registry_image_tag" label="Docker Image Tag" />
</div>
@endif
@if ($application->dockerfile)

View File

@@ -1,12 +1,12 @@
<div x-init="$wire.loadImages">
<div class="flex items-center gap-2">
<h2>Rollback</h2>
<x-forms.button wire:click='loadImages'>Reload Available Images</x-forms.button>
<x-forms.button wire:click='loadImages(true)'>Reload Available Images</x-forms.button>
</div>
<div class="pb-4 ">You can easily rollback to a previously built image quickly.</div>
<div class="pb-4 ">You can easily rollback to a previously built <span class="text-warning">(local)</span> images quickly.</div>
<div wire:target='loadImages'>
<div class="flex flex-wrap">
@foreach ($images as $image)
@forelse ($images as $image)
<div class="w-2/4 p-2">
<div class="rounded shadow-lg bg-coolgray-200">
<div class="p-2">
@@ -25,14 +25,16 @@
Rollback
</x-forms.button>
@else
<x-forms.button wire:click="rollbackImage('{{ data_get($image, 'tag') }}')">
<x-forms.button class="bg-coolgray-100" wire:click="rollbackImage('{{ data_get($image, 'tag') }}')">
Rollback
</x-forms.button>
@endif
</div>
</div>
</div>
@endforeach
@empty
<div>No images found locally.</div>
@endforelse
</div>
</div>
</div>

View File

@@ -36,7 +36,7 @@
@endif
@if ($application->build_pack !== 'static')
<a :class="activeTab === 'health' && 'text-white'"
@click.prevent="activeTab = 'health'; window.location.hash = 'health'" href="#">Health Checks
@click.prevent="activeTab = 'health'; window.location.hash = 'health'" href="#">Healthchecks
</a>
@endif
<a :class="activeTab === 'rollback' && 'text-white'"