mirror of
https://github.com/coollabsio/coolify.git
synced 2026-08-24 10:05:47 -05:00
Add configurable development QEMU profiles, host setup, VM lifecycle management, and commands to seed managed VMs as Coolify servers. Improve installation dialog logs with responsive mobile presentation.
34 lines
1.0 KiB
PHP
34 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Actions\Development;
|
|
|
|
use Illuminate\Database\QueryException;
|
|
use Illuminate\Support\Facades\Process;
|
|
use Lorisleiva\Actions\Concerns\AsAction;
|
|
|
|
class ManageDevelopmentQemuVm
|
|
{
|
|
use AsAction;
|
|
|
|
/** @param string|array<int, string> $profileNames */
|
|
public function handle(string|array $profileNames): void
|
|
{
|
|
$profileNames = is_array($profileNames) ? array_values(array_unique($profileNames)) : [$profileNames];
|
|
|
|
foreach ($profileNames as $index => $profileName) {
|
|
StartDevelopmentQemuVm::run($profileName, $index === 0);
|
|
|
|
try {
|
|
SeedDevelopmentQemuServer::run($profileName, $index === 0);
|
|
} catch (QueryException $exception) {
|
|
$keepOthers = $index === 0 ? '' : ' --keep-others';
|
|
$result = Process::run('docker exec coolify php artisan dev:qemu:seed '.escapeshellarg($profileName).$keepOthers);
|
|
|
|
if ($result->failed()) {
|
|
throw $exception;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|