mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-18 03:20:26 +00:00
feat: implement prerequisite validation and installation for server setup
This commit is contained in:
27
app/Actions/Server/ValidatePrerequisites.php
Normal file
27
app/Actions/Server/ValidatePrerequisites.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions\Server;
|
||||
|
||||
use App\Models\Server;
|
||||
use Lorisleiva\Actions\Concerns\AsAction;
|
||||
|
||||
class ValidatePrerequisites
|
||||
{
|
||||
use AsAction;
|
||||
|
||||
public string $jobQueue = 'high';
|
||||
|
||||
public function handle(Server $server): bool
|
||||
{
|
||||
$requiredCommands = ['git', 'curl', 'jq'];
|
||||
|
||||
foreach ($requiredCommands as $cmd) {
|
||||
$found = instant_remote_process(["command -v {$cmd}"], $server, false);
|
||||
if (! $found) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user