feat(Deployment): Integrate Ansible deployment via PHP deployment pipeline

- Create AnsibleDeployStage using framework's Process module for secure command execution
- Integrate AnsibleDeployStage into DeploymentPipelineCommands for production deployments
- Add force_deploy flag support in Ansible playbook to override stale locks
- Use PHP deployment module as orchestrator (php console.php deploy:production)
- Fix ErrorAggregationInitializer to use Environment class instead of $_ENV superglobal

Architecture:
- BuildStage → AnsibleDeployStage → HealthCheckStage for production
- Process module provides timeout, error handling, and output capture
- Ansible playbook supports rollback via rollback-git-based.yml
- Zero-downtime deployments with health checks
This commit is contained in:
2025-10-26 14:08:07 +01:00
parent a90263d3be
commit 3b623e7afb
170 changed files with 19888 additions and 575 deletions

View File

@@ -4,6 +4,8 @@ declare(strict_types=1);
namespace App\Framework\Queue\ValueObjects;
use App\Framework\Ulid\UlidGenerator;
/**
* Value Object representing a unique Worker identifier
*/
@@ -22,8 +24,8 @@ final readonly class WorkerId
*/
public static function generate(): self
{
// Use simple uniqid for now to avoid dependency injection in Value Objects
return new self(uniqid('worker_', true));
$generator = new UlidGenerator();
return new self('worker_' . $generator->generate());
}
/**
@@ -31,10 +33,11 @@ final readonly class WorkerId
*/
public static function forHost(string $hostname, int $pid): self
{
// Create a deterministic ID based on hostname and PID
$identifier = sprintf('%s_%d_%s', $hostname, $pid, uniqid());
$generator = new UlidGenerator();
// Create a deterministic ID based on hostname, PID, and ULID
$identifier = sprintf('%s_%d_%s', $hostname, $pid, $generator->generate());
return new self(substr(md5($identifier), 0, 16));
return new self(substr(hash('sha256', $identifier), 0, 16));
}
/**