fix update script

This commit is contained in:
Andras Bacsai
2023-04-28 15:22:36 +02:00
parent 7ea73c3db2
commit 1d2b5d5b15
5 changed files with 24 additions and 19 deletions

View File

@@ -15,9 +15,7 @@ class CheckUpdate extends Component
public function checkUpdate()
{
$response = Http::get('https://get.coollabs.io/versions.json');
$versions = $response->json();
$this->latestVersion = data_get($versions, 'coolify.v4.version');
$this->latestVersion = getLatestVersionOfCoolify();
$this->currentVersion = config('coolify.version');
if ($this->latestVersion === 'latest') {
$this->updateAvailable = true;

View File

@@ -3,6 +3,7 @@
namespace App\Http\Livewire;
use App\Models\Server;
use Illuminate\Support\Facades\Http;
use Livewire\Component;
class ForceUpgrade extends Component
@@ -22,6 +23,8 @@ class ForceUpgrade extends Component
], $server);
$this->emit('updateInitiated');
} else {
$latestVersion = getLatestVersionOfCoolify();
$cdn = "https://coolify-cdn.b-cdn.net/files";
$server = Server::where('ip', 'host.docker.internal')->first();
if (!$server) {
@@ -39,7 +42,7 @@ class ForceUpgrade extends Component
]);
remoteProcess([
"bash /data/coolify/source/upgrade.sh $this->latestVersion"
"bash /data/coolify/source/upgrade.sh $latestVersion"
], $server);
$this->emit('updateInitiated');