commit
1092d00c7a
@ -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 @@ public function handle()
|
||||
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();
|
||||
@ -52,7 +54,7 @@ private function update()
|
||||
{
|
||||
if (isDev()) {
|
||||
instant_remote_process([
|
||||
"sleep 10"
|
||||
"sleep 1"
|
||||
], $this->server);
|
||||
return;
|
||||
}
|
||||
|
@ -5,11 +5,9 @@
|
||||
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 @@ public function upgrade()
|
||||
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);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
// 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.292',
|
||||
// When left empty or `null` the Laravel environment will be used
|
||||
'environment' => config('app.env'),
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
<?php
|
||||
|
||||
return '4.0.0-beta.291';
|
||||
return '4.0.0-beta.292';
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"coolify": {
|
||||
"v4": {
|
||||
"version": "4.0.0-beta.291"
|
||||
"version": "4.0.0-beta.292"
|
||||
},
|
||||
"sentinel": {
|
||||
"version": "0.0.4"
|
||||
|
Loading…
Reference in New Issue
Block a user