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:
@@ -320,6 +320,21 @@ class Index extends Component
|
||||
return handleError(error: $e, livewire: $this);
|
||||
}
|
||||
|
||||
try {
|
||||
// Check prerequisites
|
||||
$prerequisitesInstalled = $this->createdServer->validatePrerequisites();
|
||||
if (! $prerequisitesInstalled) {
|
||||
$this->createdServer->installPrerequisites();
|
||||
// Recheck after installation
|
||||
$prerequisitesInstalled = $this->createdServer->validatePrerequisites();
|
||||
if (! $prerequisitesInstalled) {
|
||||
throw new \Exception('Prerequisites (git, curl, jq) could not be installed. Please install them manually.');
|
||||
}
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
return handleError(error: $e, livewire: $this);
|
||||
}
|
||||
|
||||
try {
|
||||
$dockerVersion = instant_remote_process(["docker version|head -2|grep -i version| awk '{print $2}'"], $this->createdServer, true);
|
||||
$dockerVersion = checkMinimumDockerEngineVersion($dockerVersion);
|
||||
|
||||
Reference in New Issue
Block a user