feat(Production): Complete production deployment infrastructure

- Add comprehensive health check system with multiple endpoints
- Add Prometheus metrics endpoint
- Add production logging configurations (5 strategies)
- Add complete deployment documentation suite:
  * QUICKSTART.md - 30-minute deployment guide
  * DEPLOYMENT_CHECKLIST.md - Printable verification checklist
  * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle
  * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference
  * production-logging.md - Logging configuration guide
  * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation
  * README.md - Navigation hub
  * DEPLOYMENT_SUMMARY.md - Executive summary
- Add deployment scripts and automation
- Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment
- Update README with production-ready features

All production infrastructure is now complete and ready for deployment.
This commit is contained in:
2025-10-25 19:18:37 +02:00
parent caa85db796
commit fc3d7e6357
83016 changed files with 378904 additions and 20919 deletions

View File

@@ -0,0 +1,94 @@
<?php
declare(strict_types=1);
namespace App\Framework\Process\Exceptions;
use App\Framework\Exception\Core\ConsoleErrorCode;
use App\Framework\Exception\Core\FileSystemErrorCode;
use App\Framework\Exception\Core\SystemErrorCode;
use App\Framework\Exception\FrameworkException;
use App\Framework\Process\ProcessResult;
use App\Framework\Process\ValueObjects\Command;
/**
* Exception für Prozess-bezogene Fehler.
*/
final class ProcessException extends FrameworkException
{
/**
* Erstellt eine Exception, wenn ein Prozess nicht gestartet werden kann.
*/
public static function failedToStart(Command $command, ?string $reason = null): self
{
$message = "Failed to start process: {$command->toString()}";
if ($reason !== null) {
$message .= " - {$reason}";
}
return self::create(
SystemErrorCode::RESOURCE_EXHAUSTED,
$message
)->withData([
'command' => $command->toString(),
'reason' => $reason,
]);
}
/**
* Erstellt eine Exception, wenn ein Prozess fehlschlägt.
*/
public static function executionFailed(ProcessResult $result): self
{
return self::create(
SystemErrorCode::INITIALIZATION_FAILED,
"Process execution failed: {$result->command->toString()}"
)->withData([
'command' => $result->command->toString(),
'exit_code' => $result->exitCode->value,
'exit_description' => $result->exitCode->getDescription(),
'stderr' => $result->stderr,
'runtime_ms' => $result->runtime->toMilliseconds(),
]);
}
/**
* Erstellt eine Exception, wenn ein Kommando nicht gefunden wird.
*/
public static function commandNotFound(string $commandName): self
{
return self::create(
ConsoleErrorCode::COMMAND_NOT_FOUND,
"Command not found: {$commandName}"
)->withData([
'command' => $commandName,
]);
}
/**
* Erstellt eine Exception, wenn ein Signal nicht gesendet werden kann.
*/
public static function failedToSendSignal(int $pid, int $signal): self
{
return self::create(
SystemErrorCode::RESOURCE_EXHAUSTED,
"Failed to send signal {$signal} to process {$pid}"
)->withData([
'pid' => $pid,
'signal' => $signal,
]);
}
/**
* Erstellt eine Exception, wenn das Arbeitsverzeichnis ungültig ist.
*/
public static function invalidWorkingDirectory(string $path): self
{
return self::create(
FileSystemErrorCode::FILE_NOT_FOUND,
"Invalid working directory: {$path}"
)->withData([
'path' => $path,
]);
}
}

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace App\Framework\Process\Exceptions;
use App\Framework\Core\ValueObjects\Duration;
use App\Framework\Exception\ErrorCode;
use App\Framework\Exception\FrameworkException;
use App\Framework\Process\ValueObjects\Command;
/**
* Exception für Prozess-Timeout-Fehler.
*/
final class ProcessTimeoutException extends FrameworkException
{
/**
* Erstellt eine Exception, wenn ein Prozess-Timeout überschritten wird.
*/
public static function exceeded(Command $command, Duration $timeout): self
{
return self::create(
ErrorCode::TEMP_FAIL,
"Process timeout exceeded: {$command->toString()} (timeout: {$timeout->toHumanReadable()})"
)->withData([
'command' => $command->toString(),
'timeout_seconds' => $timeout->toSeconds(),
'timeout_human' => $timeout->toHumanReadable(),
])->withRetryAfter((int) ceil($timeout->toSeconds()));
}
}