feat: implement prerequisite validation and installation for server setup

This commit is contained in:
Andras Bacsai
2025-11-21 09:49:33 +01:00
parent ce4f8d02a2
commit 01957f2752
9 changed files with 218 additions and 32 deletions

View 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;
}
}