-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmod.rs
More file actions
46 lines (44 loc) · 1.97 KB
/
Copy pathmod.rs
File metadata and controls
46 lines (44 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Render Command Module
//!
//! This module implements the delivery-agnostic `RenderCommandHandler`
//! for generating deployment artifacts without executing deployment operations.
//!
//! ## Architecture
//!
//! The `RenderCommandHandler` implements the Command Pattern and uses Dependency Injection
//! to interact with infrastructure services through interfaces:
//!
//! - **Repository Pattern**: Loads environment state via `EnvironmentRepository` (env-name mode)
//! - **Template Generation**: Renders all deployment artifacts to build directory
//! - **Domain-Driven Design**: Uses domain objects from `domain::environment`
//!
//! ## Design Principles
//!
//! - **Delivery-Agnostic**: Works with CLI, REST API, or any delivery mechanism
//! - **Read-Only Operations**: Does not modify environment state or execute deployments
//! - **Dual Input Modes**: Supports both existing environments and direct config files
//! - **Explicit Errors**: All errors implement `.help()` with actionable guidance
//! - **Output Separation**: Requires explicit output directory to prevent conflicts with provision artifacts
//!
//! ## State Constraints
//!
//! - **Created State Only**: Command only works for environments in "Created" state
//! - **IP Always Required**: User must provide target IP via --instance-ip flag
//! - **Output Directory Required**: User must provide output directory via --output-dir flag
//! - **Force Flag**: Use --force to overwrite existing output directory
//!
//! ## Dual Input Modes
//!
//! 1. **Environment Name Mode** (`--env-name`):
//! - Loads existing environment from repository
//! - Validates state is "Created"
//! - Uses environment configuration
//!
//! 2. **Config File Mode** (`--env-file`):
//! - Parses configuration file directly
//! - No environment creation or persistence
//! - Validates configuration only
pub mod errors;
pub mod handler;
pub use errors::RenderCommandHandlerError;
pub use handler::{RenderCommandHandler, RenderInputMode, RenderResult};