@@ -5,6 +5,7 @@ namespace App\Console\Commands;
|
|||||||
use App\Enums\ApplicationDeploymentStatus;
|
use App\Enums\ApplicationDeploymentStatus;
|
||||||
use App\Models\Application;
|
use App\Models\Application;
|
||||||
use App\Models\ApplicationDeploymentQueue;
|
use App\Models\ApplicationDeploymentQueue;
|
||||||
|
use App\Models\InstanceSettings;
|
||||||
use App\Models\Service;
|
use App\Models\Service;
|
||||||
use App\Models\ServiceApplication;
|
use App\Models\ServiceApplication;
|
||||||
use App\Models\ServiceDatabase;
|
use App\Models\ServiceDatabase;
|
||||||
@@ -14,6 +15,7 @@ use App\Models\StandaloneMysql;
|
|||||||
use App\Models\StandalonePostgresql;
|
use App\Models\StandalonePostgresql;
|
||||||
use App\Models\StandaloneRedis;
|
use App\Models\StandaloneRedis;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
class Init extends Command
|
class Init extends Command
|
||||||
@@ -23,7 +25,7 @@ class Init extends Command
|
|||||||
|
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
ray()->clearAll();
|
$this->alive();
|
||||||
$cleanup = $this->option('cleanup');
|
$cleanup = $this->option('cleanup');
|
||||||
if ($cleanup) {
|
if ($cleanup) {
|
||||||
$this->cleanup_stucked_resources();
|
$this->cleanup_stucked_resources();
|
||||||
@@ -31,7 +33,22 @@ class Init extends Command
|
|||||||
}
|
}
|
||||||
$this->cleanup_in_progress_application_deployments();
|
$this->cleanup_in_progress_application_deployments();
|
||||||
}
|
}
|
||||||
|
private function alive()
|
||||||
|
{
|
||||||
|
$id = config('app.id');
|
||||||
|
$settings = InstanceSettings::get();
|
||||||
|
$do_not_track = data_get($settings, 'do_not_track');
|
||||||
|
if ($do_not_track == true) {
|
||||||
|
echo "Skipping alive as do_not_track is enabled\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
echo "I am alive!\n";
|
||||||
|
Http::get("https://get.coollabs.io/coolify/v4/alive?appId=$id");
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
echo "Error in alive: {$e->getMessage()}\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
private function cleanup_ssh()
|
private function cleanup_ssh()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
@@ -21,15 +21,6 @@ class DockerCleanupJob implements ShouldQueue, ShouldBeEncrypted
|
|||||||
public ?string $dockerRootFilesystem = null;
|
public ?string $dockerRootFilesystem = null;
|
||||||
public ?int $usageBefore = null;
|
public ?int $usageBefore = null;
|
||||||
|
|
||||||
public function middleware(): array
|
|
||||||
{
|
|
||||||
return [(new WithoutOverlapping($this->server->uuid))];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function uniqueId(): string
|
|
||||||
{
|
|
||||||
return $this->server->uuid;
|
|
||||||
}
|
|
||||||
public function __construct(public Server $server)
|
public function __construct(public Server $server)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,7 @@ return [
|
|||||||
|
|
||||||
// The release version of your application
|
// The release version of your application
|
||||||
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
|
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
|
||||||
'release' => '4.0.0-beta.135',
|
'release' => '4.0.0-beta.136',
|
||||||
// When left empty or `null` the Laravel environment will be used
|
// When left empty or `null` the Laravel environment will be used
|
||||||
'environment' => config('app.env'),
|
'environment' => config('app.env'),
|
||||||
|
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return '4.0.0-beta.135';
|
return '4.0.0-beta.136';
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
"version": "3.12.36"
|
"version": "3.12.36"
|
||||||
},
|
},
|
||||||
"v4": {
|
"v4": {
|
||||||
"version": "4.0.0-beta.135"
|
"version": "4.0.0-beta.136"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user