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:
55
src/Framework/Notification/Templates/ChannelTemplate.php
Normal file
55
src/Framework/Notification/Templates/ChannelTemplate.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Notification\Templates;
|
||||
|
||||
/**
|
||||
* Channel-specific Template Customization
|
||||
*
|
||||
* Allows overriding title/body templates per channel
|
||||
* Use case: Telegram supports Markdown, Email supports HTML, SMS is plain text
|
||||
*/
|
||||
final readonly class ChannelTemplate
|
||||
{
|
||||
/**
|
||||
* @param string|null $titleTemplate Channel-specific title template (null = use default)
|
||||
* @param string|null $bodyTemplate Channel-specific body template (null = use default)
|
||||
* @param array<string, mixed> $metadata Channel-specific metadata (e.g., parse_mode for Telegram)
|
||||
*/
|
||||
public function __construct(
|
||||
public ?string $titleTemplate = null,
|
||||
public ?string $bodyTemplate = null,
|
||||
public array $metadata = []
|
||||
) {
|
||||
}
|
||||
|
||||
public static function create(
|
||||
?string $titleTemplate = null,
|
||||
?string $bodyTemplate = null
|
||||
): self {
|
||||
return new self(
|
||||
titleTemplate: $titleTemplate,
|
||||
bodyTemplate: $bodyTemplate
|
||||
);
|
||||
}
|
||||
|
||||
public function withMetadata(array $metadata): self
|
||||
{
|
||||
return new self(
|
||||
titleTemplate: $this->titleTemplate,
|
||||
bodyTemplate: $this->bodyTemplate,
|
||||
metadata: [...$this->metadata, ...$metadata]
|
||||
);
|
||||
}
|
||||
|
||||
public function hasCustomTitle(): bool
|
||||
{
|
||||
return $this->titleTemplate !== null;
|
||||
}
|
||||
|
||||
public function hasCustomBody(): bool
|
||||
{
|
||||
return $this->bodyTemplate !== null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user