Compare commits

...

10 Commits

Author SHA1 Message Date
Andras Bacsai
85ca38be90 Merge pull request #2325 from coollabsio/next
v4.0.0-beta.293
2024-05-30 20:08:37 +02:00
Andras Bacsai
7c9790dff0 chore: Improve upgrade.blade.php with clearer instructions and formatting 2024-05-30 20:07:42 +02:00
Andras Bacsai
40a71a11cb chore: Add upgrade guide link to upgrade.blade.php 2024-05-30 20:07:06 +02:00
Andras Bacsai
46a500f5e5 async update process 2024-05-30 20:02:11 +02:00
Andras Bacsai
2d1d03bf8e chore: Update version numbers to 4.0.0-beta.293 2024-05-30 20:02:03 +02:00
Andras Bacsai
1092d00c7a Merge pull request #2324 from coollabsio/next
v4.0.0-beta.292
2024-05-30 19:46:11 +02:00
Andras Bacsai
cd58e0d01e fixes 2024-05-30 19:45:36 +02:00
Andras Bacsai
30a9783348 feat: Add manual update option to UpdateCoolify handle method 2024-05-30 19:38:33 +02:00
Andras Bacsai
c839cf50af fix: spamming :D 2024-05-30 19:35:44 +02:00
Andras Bacsai
f8d607b06f chore: Update version numbers to 4.0.0-beta.292 2024-05-30 19:35:38 +02:00
6 changed files with 23 additions and 21 deletions

View File

@@ -14,7 +14,7 @@ class UpdateCoolify
public ?string $latestVersion = null;
public ?string $currentVersion = null;
public function handle()
public function handle($manual_update = false)
{
try {
$settings = InstanceSettings::get();
@@ -26,17 +26,19 @@ class UpdateCoolify
CleanupDocker::run($this->server, false);
$this->latestVersion = get_latest_version_of_coolify();
$this->currentVersion = config('version');
if (!$settings->is_auto_update_enabled) {
Log::info('Auto update is disabled');
throw new \Exception('Auto update is disabled');
}
if ($this->latestVersion === $this->currentVersion) {
Log::info('Already on latest version');
throw new \Exception('Already on latest version');
}
if (version_compare($this->latestVersion, $this->currentVersion, '<')) {
Log::info('Latest version is lower than current version?!');
throw new \Exception('Latest version is lower than current version?!');
if (!$manual_update) {
if (!$settings->is_auto_update_enabled) {
Log::debug('Auto update is disabled');
return;
}
if ($this->latestVersion === $this->currentVersion) {
Log::debug('Already on latest version');
return;
}
if (version_compare($this->latestVersion, $this->currentVersion, '<')) {
Log::debug('Latest version is lower than current version?!');
return;
}
}
Log::info("Updating from {$this->currentVersion} -> {$this->latestVersion}");
$this->update();
@@ -51,12 +53,12 @@ class UpdateCoolify
private function update()
{
if (isDev()) {
instant_remote_process([
remote_process([
"sleep 10"
], $this->server);
return;
}
instant_remote_process([
remote_process([
"curl -fsSL https://cdn.coollabs.io/coolify/upgrade.sh -o /data/coolify/source/upgrade.sh",
"bash /data/coolify/source/upgrade.sh $this->latestVersion"
], $this->server);

View File

@@ -5,11 +5,9 @@ namespace App\Livewire;
use App\Actions\Server\UpdateCoolify;
use Livewire\Component;
use DanHarrin\LivewireRateLimiting\WithRateLimiting;
class Upgrade extends Component
{
use WithRateLimiting;
public bool $showProgress = false;
public bool $updateInProgress = false;
public bool $isUpgradeAvailable = false;
@@ -31,9 +29,8 @@ class Upgrade extends Component
if ($this->updateInProgress) {
return;
}
$this->rateLimit(1, 60);
$this->updateInProgress = true;
UpdateCoolify::run();
UpdateCoolify::run(manual_update: true);
} catch (\Throwable $e) {
return handleError($e, $this);
}

View File

@@ -7,7 +7,7 @@ return [
// The release version of your application
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
'release' => '4.0.0-beta.291',
'release' => '4.0.0-beta.293',
// When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'),

View File

@@ -1,3 +1,3 @@
<?php
return '4.0.0-beta.291';
return '4.0.0-beta.293';

View File

@@ -60,6 +60,9 @@
<br />
<p>You can review the changelogs <a class="font-bold underline"
href="https://github.com/coollabsio/coolify/releases" target="_blank">here</a>.</p>
<br />
<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" target="_blank">guide</a> on what to do.</p>
@if ($showProgress)
<div class="flex flex-col pt-4">
<h4>Progress <x-loading /></h4>

View File

@@ -1,7 +1,7 @@
{
"coolify": {
"v4": {
"version": "4.0.0-beta.291"
"version": "4.0.0-beta.293"
},
"sentinel": {
"version": "0.0.4"