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:
@@ -56,12 +56,13 @@ final readonly class ErrorBoundaryMiddleware implements HttpMiddleware
|
||||
*/
|
||||
private function createJsonFallbackResponse($request): JsonResponse
|
||||
{
|
||||
$generator = new \App\Framework\Ulid\UlidGenerator();
|
||||
$errorData = [
|
||||
'error' => [
|
||||
'code' => 'SERVICE_TEMPORARILY_UNAVAILABLE',
|
||||
'message' => 'The service is temporarily unavailable. Please try again later.',
|
||||
'timestamp' => date(\DateTimeInterface::ISO8601),
|
||||
'request_id' => $request->headers->get('X-Request-ID') ?? uniqid(),
|
||||
'request_id' => $request->headers->get('X-Request-ID') ?? $generator->generate(),
|
||||
],
|
||||
'fallback' => true,
|
||||
];
|
||||
@@ -74,12 +75,13 @@ final readonly class ErrorBoundaryMiddleware implements HttpMiddleware
|
||||
*/
|
||||
private function createHtmlFallbackResponse($request, MiddlewareContext $context)
|
||||
{
|
||||
$generator = new \App\Framework\Ulid\UlidGenerator();
|
||||
$fallbackHtml = $this->getFallbackHtmlContent($request);
|
||||
|
||||
return new ViewResult($fallbackHtml, [
|
||||
'request' => $request,
|
||||
'timestamp' => date(\DateTimeInterface::ISO8601),
|
||||
'request_id' => $request->headers->get('X-Request-ID') ?? uniqid(),
|
||||
'request_id' => $request->headers->get('X-Request-ID') ?? $generator->generate(),
|
||||
], Status::SERVICE_UNAVAILABLE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user