fix update script
This commit is contained in:
@@ -7,21 +7,21 @@ use Illuminate\Http\Client\PendingRequest;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Http\Client\Pool;
|
||||
|
||||
class SyncToBunnyCDN extends Command
|
||||
class SyncBunny extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'app:sync-to-bunny-cdn';
|
||||
protected $signature = 'sync:bunny';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Command description';
|
||||
protected $description = 'Sync files to BunnyCDN';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
@@ -67,10 +67,10 @@ class SyncToBunnyCDN extends Command
|
||||
"url" => "$bunny_cdn/$bunny_cdn_path/$production_env"
|
||||
]);
|
||||
if ($res->ok()) {
|
||||
echo 'All files uploaded & purged...';
|
||||
echo "All files uploaded & purged...\n";
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
echo 'Something went wrong.';
|
||||
echo "Something went wrong.\n";
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user