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

@@ -300,30 +300,58 @@ final readonly class UserCommands
```html
<!-- ✅ Framework Template Patterns -->
<div class="user-card">
<h2>{user.name}</h2>
<p>{user.email}</p>
<!-- Object property access -->
<h2>{{ $user->name }}</h2>
<p>{{ $user->email }}</p>
<!-- Conditional Rendering -->
<if condition="user.isAdmin">
<span class="badge">Admin</span>
</if>
<!-- Method calls -->
<p>{{ $user->getFullName() }}</p>
<!-- Loop Rendering -->
<for items="user.posts" as="post">
<article>
<h3>{post.title}</h3>
<p>{post.excerpt}</p>
</for>
</for>
<!-- Conditional Rendering - if attribute -->
<span class="badge" if="{{ $user->isAdmin() }}">Admin</span>
<!-- Negation -->
<p if="!{{ $user->isAdmin() }}">Regular User</p>
<!-- Loop Rendering - foreach attribute (PHP-style) -->
<article foreach="$user->posts as $post">
<h3>{{ $post->title }}</h3>
<p>{{ $post->getExcerpt() }}</p>
</article>
<!-- Loop with key-value pairs -->
<div foreach="$items as $key => $value">
<span>{{ $key }}: {{ $value }}</span>
</div>
<!-- Component Inclusion -->
<include template="components/avatar" data="user.avatar" />
<include template="components/avatar" data="{{ $user->avatar }}" />
<!-- Slot System -->
<slot name="header">Default Header</slot>
</div>
```
**CRITICAL TEMPLATE ENGINE RULES**:
1. **Placeholder Syntax**: ALWAYS `{{ $variable }}` with dollar sign
2. **Object Access**:
- Properties: `{{ $object->property }}`
- Methods: `{{ $object->method() }}`
- Arrays: `{{ $array['key'] }}` (still supported)
3. **Conditional Rendering**: Use `if` attribute
- Example: `<div if="{{ $hasData }}">content</div>`
- Negation: `<div if="!{{ $hasData }}">no data</div>`
4. **Loop Rendering**: Use `foreach` attribute (PHP-style)
- Simple: `<div foreach="$items as $item">{{ $item->name }}</div>`
- With key: `<tr foreach="$models as $index => $model">...</tr>`
5. **NO custom tags for logic**: Only standard HTML tags with attributes
**PHP-Style Syntax Benefits**:
- Native PHP developers immediately understand the syntax
- Object properties and methods work naturally
- `foreach` syntax identical to PHP
- Supports key-value iteration out of the box
**Template Processors Integration**:
```php
// ✅ Custom Template Processor Pattern
@@ -348,6 +376,17 @@ final readonly class DesignSystemProcessor
}
```
**Registered Template Processors**:
- **PlaceholderReplacer**: Variable substitution with `{{ $var }}` syntax, object access `{{ $obj->prop }}`, method calls `{{ $obj->method() }}`
- **ForeachAttributeProcessor**: Loop rendering via `foreach="$items as $item"` attribute
- **IfAttributeProcessor**: Conditional rendering via `if="{{ $condition }}"` attribute
- **ComponentProcessor**: Component inclusion & slot system
- **LayoutTagProcessor**: Layout system integration
- **MetaManipulator**: Meta tags & SEO management
- **AssetInjector**: CSS/JS asset management
- **CsrfTokenProcessor**: Security integration
- **HoneypotProcessor**: Spam protection
**CSS Architecture (ITCSS) Expertise**:
**Layer Structure**:
@@ -514,16 +553,14 @@ enum SpacingSize: string
<!-- ✅ WCAG-compliant Templates -->
<nav aria-label="Main navigation">
<ul role="list">
<for items="menuItems" as="item">
<li>
<a
href="{item.url}"
aria-current="{item.isActive ? 'page' : null}"
>
{item.label}
</a>
</li>
</for>
<li foreach="$menuItems as $item">
<a
href="{{ $item['url'] }}"
aria-current="{{ $item['isActive'] ? 'page' : null }}"
>
{{ $item['label'] }}
</a>
</li>
</ul>
</nav>
@@ -540,16 +577,14 @@ enum SpacingSize: string
aria-labelledby="email-label"
aria-describedby="email-hint email-error"
aria-required="true"
aria-invalid="{hasError ? 'true' : 'false'}"
aria-invalid="{{ $hasError ? 'true' : 'false' }}"
/>
<span id="email-hint" class="form-hint">
We'll never share your email
</span>
<if condition="hasError">
<span id="email-error" role="alert" class="form-error">
{errorMessage}
</span>
</if>
<span id="email-error" role="alert" class="form-error" if="{{ $hasError }}">
{{ $errorMessage }}
</span>
</div>
</form>
```
@@ -629,16 +664,21 @@ final readonly class DesignSystemRegistry
- **Design Token Coverage**: 100% - keine Hard-coded Colors/Spacing
**Integration mit Template Processors**:
- **PlaceholderReplacer**: Variable Substitution
- **PlaceholderReplacer**: Variable Substitution mit `{{ $var }}` Syntax
- **ComponentProcessor**: Component Inclusion & Slot System
- **ForProcessor**: Loop Rendering
- **IfProcessor**: Conditional Rendering
- **ForAttributeProcessor**: Loop Rendering via `for-items` und `for-value` Attribute
- **IfAttributeProcessor**: Conditional Rendering via `if` Attribut (+ `condition` deprecated fallback)
- **LayoutTagProcessor**: Layout System
- **MetaManipulator**: Meta Tags & SEO
- **AssetInjector**: CSS/JS Asset Management
- **CsrfTokenProcessor**: Security Integration
- **HoneypotProcessor**: Spam Protection
**Deprecated Syntax (backwards compatible)**:
-`<for items="..." as="...">` → ✅ Use `for-items` and `for-value` attributes
-`<if condition="...">` → ✅ Use `if` attribute on element
-`condition` attribute → ✅ Use `if` attribute (condition still supported)
**Performance Optimization**:
```php
// ✅ Critical CSS Extraction