improve: update process

This commit is contained in:
Andras Bacsai 2024-06-25 12:48:56 +02:00
parent 8b95b93c72
commit a849c25672
2 changed files with 11 additions and 5 deletions

View File

@ -25,7 +25,7 @@ public function handle($manual_update = false)
if (! $this->server) { if (! $this->server) {
return; return;
} }
CleanupDocker::run($this->server, false); CleanupDocker::dispatch($this->server, false)->onQueue('high');
$this->latestVersion = get_latest_version_of_coolify(); $this->latestVersion = get_latest_version_of_coolify();
$this->currentVersion = config('version'); $this->currentVersion = config('version');
if (! $manual_update) { if (! $manual_update) {
@ -48,6 +48,7 @@ public function handle($manual_update = false)
private function update() private function update()
{ {
if (isDev()) { if (isDev()) {
ray('Running in dev mode');
remote_process([ remote_process([
'sleep 10', 'sleep 10',
], $this->server); ], $this->server);

View File

@ -58,25 +58,26 @@ class="absolute top-0 right-0 flex items-center justify-center w-8 h-8 mt-5 mr-5
<div class="relative w-auto pb-8"> <div class="relative w-auto pb-8">
<p>Are you sure you would like to upgrade your instance to {{ $latestVersion }}?</p> <p>Are you sure you would like to upgrade your instance to {{ $latestVersion }}?</p>
<br /> <br />
<p>You can review the changelogs <a class="font-bold underline" <p>You can review the changelogs <a class="font-bold underline dark:text-white"
href="https://github.com/coollabsio/coolify/releases" target="_blank">here</a>.</p> href="https://github.com/coollabsio/coolify/releases" target="_blank">here</a>.</p>
<br /> <br />
<p>If something goes wrong and you cannot upgrade your instance, You can check the following <p>If something goes wrong and you cannot upgrade your instance, You can check the following
<a class="font-bold underline" href="https://coolify.io/docs/upgrade" <a class="font-bold underline dark:text-white" href="https://coolify.io/docs/upgrade"
target="_blank">guide</a> on what to do. target="_blank">guide</a> on what to do.
</p> </p>
@if ($showProgress) @if ($showProgress)
<div class="flex flex-col pt-4"> <div class="flex flex-col pt-4">
<h4>Progress <x-loading /></h4> <h2>Progress <x-loading /></h2>
<div x-html="currentStatus"></div> <div x-html="currentStatus"></div>
</div> </div>
@endif @endif
</div> </div>
<div class="flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2"> <div class="flex gap-4">
@if (!$showProgress) @if (!$showProgress)
<x-forms.button @click="modalOpen=false" <x-forms.button @click="modalOpen=false"
class="w-24 dark:bg-coolgray-200 dark:hover:bg-coolgray-300">Cancel class="w-24 dark:bg-coolgray-200 dark:hover:bg-coolgray-300">Cancel
</x-forms.button> </x-forms.button>
<div class="flex-1"></div>
<x-forms.button @click="confirmed" class="w-24" isHighlighted type="button">Continue <x-forms.button @click="confirmed" class="w-24" isHighlighted type="button">Continue
</x-forms.button> </x-forms.button>
@endif @endif
@ -98,6 +99,10 @@ class="w-24 dark:bg-coolgray-200 dark:hover:bg-coolgray-300">Cancel
this.$wire.$call('upgrade') this.$wire.$call('upgrade')
this.upgrade(); this.upgrade();
this.$wire.showProgress = true; this.$wire.showProgress = true;
window.addEventListener('beforeunload', (event) => {
event.preventDefault();
event.returnValue = '';
});
}, },
revive() { revive() {
if (checkHealthInterval) return true; if (checkHealthInterval) return true;