pub struct RenderCommandHandler { /* private fields */ }Expand description
RenderCommandHandler generates deployment artifacts without deployment
This command handler provides a way to preview or generate deployment artifacts (docker-compose files, Ansible playbooks, tracker config, etc.) without executing any infrastructure operations.
§State Management
- Created State Only: Command works for environments in “Created” state
- Already Provisioned: Returns informational result (not error) with artifacts location
- No State Modification: Does not change environment state or execute deployments
§Dual Input Modes
- Environment Name Mode: Loads existing environment from repository
- Config File Mode: Parses configuration file directly (no env creation)
§Workflow
- Determine input mode (env-name or env-file)
- Load/parse configuration
- Validate state (Created only for existing environments)
- Parse target IP address
- Render all deployment templates to build/{env}/ directory
Implementations§
Source§impl RenderCommandHandler
impl RenderCommandHandler
Sourcepub fn new(repository: Arc<dyn EnvironmentRepository>) -> Self
pub fn new(repository: Arc<dyn EnvironmentRepository>) -> Self
Create a new RenderCommandHandler
Sourcepub async fn execute(
&self,
input_mode: RenderInputMode,
target_ip: &str,
output_dir: &Path,
force: bool,
working_dir: &Path,
) -> Result<RenderResult, RenderCommandHandlerError>
pub async fn execute( &self, input_mode: RenderInputMode, target_ip: &str, output_dir: &Path, force: bool, working_dir: &Path, ) -> Result<RenderResult, RenderCommandHandlerError>
Execute the render workflow
§Arguments
input_mode- Source of configuration (env-name or env-file)target_ip- Target instance IP address (always required)output_dir- Output directory for generated artifactsforce- Whether to overwrite existing output directoryworking_dir- Working directory for resolving relative paths
§Returns
Returns RenderResult with paths to generated artifacts
§Errors
Returns an error if:
- Environment not found (env-name mode)
- Config file not found or invalid (env-file mode)
- IP address parsing fails
- Output directory exists and force is false
- Template rendering fails
Auto Trait Implementations§
impl !RefUnwindSafe for RenderCommandHandler
impl !Send for RenderCommandHandler
impl !Sync for RenderCommandHandler
impl !UnwindSafe for RenderCommandHandler
impl Freeze for RenderCommandHandler
impl Unpin for RenderCommandHandler
impl UnsafeUnpin for RenderCommandHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request