mirror of
https://github.com/coollabsio/coolify.git
synced 2026-08-28 18:14:35 -05:00
Integrates Valkey as a new standalone database type. This includes adding the necessary model, updating actions to handle Valkey instances, and documenting the integration process.
64 lines
2.2 KiB
PHP
64 lines
2.2 KiB
PHP
<?php
|
|
|
|
namespace App\Actions\Database;
|
|
|
|
use App\Models\StandaloneClickhouse;
|
|
use App\Models\StandaloneDragonfly;
|
|
use App\Models\StandaloneKeydb;
|
|
use App\Models\StandaloneMariadb;
|
|
use App\Models\StandaloneMongodb;
|
|
use App\Models\StandaloneMysql;
|
|
use App\Models\StandalonePostgresql;
|
|
use App\Models\StandaloneRedis;
|
|
use App\Models\StandaloneValkey;
|
|
use Lorisleiva\Actions\Concerns\AsAction;
|
|
|
|
class StartDatabase
|
|
{
|
|
use AsAction;
|
|
|
|
public string $jobQueue = 'high';
|
|
|
|
public function handle(StandaloneRedis|StandaloneValkey|StandalonePostgresql|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|StandaloneKeydb|StandaloneDragonfly|StandaloneClickhouse $database)
|
|
{
|
|
$server = $database->destination->server;
|
|
if (! $server->isFunctional()) {
|
|
return 'Server is not functional';
|
|
}
|
|
switch ($database->getMorphClass()) {
|
|
case \App\Models\StandalonePostgresql::class:
|
|
$activity = StartPostgresql::run($database);
|
|
break;
|
|
case \App\Models\StandaloneRedis::class:
|
|
$activity = StartRedis::run($database);
|
|
break;
|
|
case \App\Models\StandaloneValkey::class:
|
|
$activity = StartValkey::run($database);
|
|
break;
|
|
case \App\Models\StandaloneMongodb::class:
|
|
$activity = StartMongodb::run($database);
|
|
break;
|
|
case \App\Models\StandaloneMysql::class:
|
|
$activity = StartMysql::run($database);
|
|
break;
|
|
case \App\Models\StandaloneMariadb::class:
|
|
$activity = StartMariadb::run($database);
|
|
break;
|
|
case \App\Models\StandaloneKeydb::class:
|
|
$activity = StartKeydb::run($database);
|
|
break;
|
|
case \App\Models\StandaloneDragonfly::class:
|
|
$activity = StartDragonfly::run($database);
|
|
break;
|
|
case \App\Models\StandaloneClickhouse::class:
|
|
$activity = StartClickhouse::run($database);
|
|
break;
|
|
}
|
|
if ($database->is_public && $database->public_port) {
|
|
StartDatabaseProxy::dispatch($database);
|
|
}
|
|
|
|
return $activity;
|
|
}
|
|
}
|