mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
- Stop the Redis username accessor from creating REDIS_USERNAME on read - Keep source values when cloning applications (no duplicate NIXPACKS_NODE_VERSION) - Match exact keys when adding default database environment variables - Write content files before database containers start - Resolve the database proxy upstream through Docker DNS on each connection - Remove existing duplicate REDIS_USERNAME and NIXPACKS_NODE_VERSION rows
31 lines
1.0 KiB
PHP
31 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Traits;
|
|
|
|
use App\Services\DatabaseStartCommandExecutor;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Collection;
|
|
use Spatie\Activitylog\Models\Activity;
|
|
|
|
trait ExecutesDatabaseStartCommands
|
|
{
|
|
private function executeDatabaseStartCommands(array $commands, Model $database, ?Activity $activity = null): Activity
|
|
{
|
|
if ($activity) {
|
|
return app(DatabaseStartCommandExecutor::class)->execute($commands, $database, $activity);
|
|
}
|
|
|
|
return remote_process($commands, $database->destination->server, callEventOnFinish: 'DatabaseStatusChanged', queue: deployment_queue());
|
|
}
|
|
|
|
/**
|
|
* Whether a `KEY=value` list already defines the exact key (not just a key or value containing it).
|
|
*
|
|
* @param Collection<int, string> $environmentVariables
|
|
*/
|
|
private function hasEnvironmentVariable(Collection $environmentVariables, string $key): bool
|
|
{
|
|
return $environmentVariables->contains(fn ($variable) => str($variable)->before('=')->value() === $key);
|
|
}
|
|
}
|