Skip to content

Commit e2726d9

Browse files
committed
fix: manual update process
1 parent 2be92a1 commit e2726d9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

app/Actions/Server/UpdateCoolify.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use App\Models\InstanceSettings;
66
use App\Models\Server;
7+
use Illuminate\Support\Facades\File;
8+
use Illuminate\Support\Facades\Http;
79
use Lorisleiva\Actions\Concerns\AsAction;
810

911
class UpdateCoolify
@@ -25,6 +27,11 @@ public function handle($manual_update = false)
2527
return;
2628
}
2729
CleanupDocker::dispatch($this->server, false)->onQueue('high');
30+
$response = Http::retry(3, 1000)->get('https://cdn.coollabs.io/coolify/versions.json');
31+
if ($response->successful()) {
32+
$versions = $response->json();
33+
File::put(base_path('versions.json'), json_encode($versions, JSON_PRETTY_PRINT));
34+
}
2835
$this->latestVersion = get_latest_version_of_coolify();
2936
$this->currentVersion = config('version');
3037
if (! $manual_update) {
@@ -39,6 +46,8 @@ public function handle($manual_update = false)
3946
}
4047
}
4148
$this->update();
49+
$settings->new_version_available = false;
50+
$settings->save();
4251
} catch (\Throwable $e) {
4352
throw $e;
4453
}

0 commit comments

Comments
 (0)