You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a command that generates all deployment artifacts (docker-compose files, tracker configuration, Ansible playbooks, Caddy configuration, etc.) to a user-specified output directory without executing any deployment operations. This enables users who want the generated configuration files but prefer to handle deployment manually.
This complements the validate command (which validates input without generating artifacts) and forms part of the "lightweight adoption" trilogy for flexible tool usage.
Note for Contributors: These criteria define what the PR reviewer will check. Use this as your pre-review checklist before submitting the PR to minimize back-and-forth iterations.
Quality Checks:
Pre-commit checks pass: ./scripts/pre-commit.sh
Functional Requirements:
Command generates all artifacts for given environment (from --env-name + --output-dir)
Command generates all artifacts from config file (from --env-file + --ip + --output-dir)
Both input modes produce identical output for same configuration and IP
--output-dir is REQUIRED (command fails without it)
--ip is REQUIRED when using --env-file (command fails without it)
--ip is FORBIDDEN when using --env-name (command fails if provided)
IP address is validated for correct format
IP address is correctly written to Ansible inventory template
ALL templates are ALWAYS generated (no conditional rendering)
Overview
Add a command that generates all deployment artifacts (docker-compose files, tracker configuration, Ansible playbooks, Caddy configuration, etc.) to a user-specified output directory without executing any deployment operations. This enables users who want the generated configuration files but prefer to handle deployment manually.
This complements the
validatecommand (which validates input without generating artifacts) and forms part of the "lightweight adoption" trilogy for flexible tool usage.Specification
See detailed specification: docs/issues/artifact-generation-command.md
(Link will be updated after file rename with issue number)
🏗️ Architecture Requirements
DDD Layers: Application + Infrastructure (template rendering)
Module Paths:
src/application/command_handlers/render/(orgenerate) - Command handler (new)src/presentation/controllers/render/- CLI controller (new)src/infrastructure/external_tools/ansible/template/renderer/- Reuse existingsrc/infrastructure/external_tools/docker/template/renderer/- Reuse existingPattern: Command Handler + Template Renderers (reuse from Release/Configure)
Module Structure Requirements
Architectural Constraints
--output-diris REQUIRED (avoid conflicts with internalbuild/directory)--ipflag)UserOutputabstractionAnti-Patterns to Avoid
build/directory for user-facing outputImplementation Plan
Phase 1: Application Layer - Command Handler (2-3 hours)
src/application/command_handlers/render/mod.rsRenderCommandHandlerstructRenderInput(environment name OR config file path + IP, plus output directory)RenderOutput(output directory path + target IP)RenderCommandHandlerErrorenumPhase 2: Template Orchestration (3-4 hours)
UserOutputPhase 3: Presentation Layer - CLI Command (2 hours)
src/presentation/controllers/render/mod.rsRenderCommandControllerRenderCommandHandlerUserOutput(progress, success, output directory path, target IP)Phase 4: Documentation and Testing (2-3 hours)
docs/user-guide/commands/render.mddocs/console-commands.mdwith render commanddocs/roadmap.md) - mark task 9.2 complete./scripts/pre-commit.shPhase 5: Polish and Review (1-2 hours)
Total Estimated Time: 10-14 hours
Acceptance Criteria
Quality Checks:
./scripts/pre-commit.shFunctional Requirements:
--env-name+--output-dir)--env-file+--ip+--output-dir)--output-diris REQUIRED (command fails without it)--ipis REQUIRED when using--env-file(command fails without it)--ipis FORBIDDEN when using--env-name(command fails if provided)build/directory)--forceflag overwrites existing output directory--force, fails if output directory existsCode Quality:
UserOutputabstractionDocumentation:
docs/user-guide/commands/render.mddocs/console-commands.mdTesting:
Related
Command Name Decision
Recommendation:
renderProjectGenerator,TemplateRenderer)Alternative:
generate(more user-friendly ifrenderis too technical)