class

Hwaro::Services::Deployer

Inherits Reference / Object

Constants

COMMAND_PLACEHOLDERS = {"source", "url", "target"}

Supported placeholders in command = "..." templates. Listed here so expand_placeholders can produce a helpful error message when an unknown {foo} slips through (typo, forward-looking name, etc.) instead of sending the literal to the shell.

DANGEROUS_SHELL_PATTERNS = /[|;&`$]|\bsudo\b|\brm\s+-rf\b/

Shell metacharacters that indicate potentially dangerous commands. These are not inherently bad but warrant user attention when present in deploy commands, especially from remote scaffolds.

Instance methods

deploy_structured(options : Config::Options::DeployOptions, config : Models::Config | Nil = nil) : Array(DeployResult)

Run a real deploy and return a per-target summary suitable for hwaro deploy --json (no --dry-run). Each target is deployed independently — an exception in one target is captured in its DeployResult.error and does NOT abort the remaining targets, so partial failures are visible to agents/CI.

Config-load errors intentionally propagate as HwaroError so the caller can emit a top-level error payload (shape unchanged).

Source
plan(options : Config::Options::DeployOptions, config : Models::Config | Nil = nil) : Array(PlannedOp)

Build a list of planned operations across all configured (or explicitly requested) targets without performing any filesystem writes or external commands. Raises the same classified errors as #run (missing source, no/unknown targets, bad target config, overlap, delete cap) so hwaro deploy --dry-run --json fails the same way a real deploy would instead of reporting an empty plan.

Source
run(options : Config::Options::DeployOptions, config : Models::Config | Nil = nil) : Bool
Source

Nested types