mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-07 17:02:34 +00:00
Plugins base (#613)
* wip * wip * cleanup * notification channels * phpstan * services * remove server types * refactoring * refactoring
This commit is contained in:
@ -2,20 +2,18 @@
|
||||
|
||||
namespace Tests\Traits;
|
||||
|
||||
use App\Enums\Database;
|
||||
use App\Enums\LoadBalancerMethod;
|
||||
use App\Enums\PHP;
|
||||
use App\Enums\ServiceStatus;
|
||||
use App\Enums\SiteType;
|
||||
use App\Enums\Webserver;
|
||||
use App\Models\Server;
|
||||
use App\Models\Site;
|
||||
use App\SiteTypes\LoadBalancer;
|
||||
use App\SiteTypes\PHPBlank;
|
||||
|
||||
trait PrepareLoadBalancer
|
||||
{
|
||||
private function prepare(): void
|
||||
{
|
||||
$this->site->type = SiteType::LOAD_BALANCER;
|
||||
$this->site->type = LoadBalancer::id();
|
||||
$this->site->type_data = [
|
||||
'method' => LoadBalancerMethod::ROUND_ROBIN,
|
||||
];
|
||||
@ -26,11 +24,6 @@ private function prepare(): void
|
||||
'project_id' => $this->user->current_project_id,
|
||||
]);
|
||||
foreach ($servers as $server) {
|
||||
$server->type()->createServices([
|
||||
'webserver' => Webserver::NGINX,
|
||||
'database' => Database::NONE,
|
||||
'php' => PHP::NONE,
|
||||
]);
|
||||
$server->services()->update([
|
||||
'status' => ServiceStatus::READY,
|
||||
]);
|
||||
@ -38,7 +31,7 @@ private function prepare(): void
|
||||
'domain' => 'vito.test',
|
||||
'aliases' => ['www.vito.test'],
|
||||
'server_id' => $server->id,
|
||||
'type' => SiteType::PHP_BLANK,
|
||||
'type' => PHPBlank::id(),
|
||||
'path' => '/home/vito/vito.test',
|
||||
'web_directory' => '',
|
||||
]);
|
||||
|
Reference in New Issue
Block a user