Plan and Apply
NDploy splits rollout into two explicit phases. This is not just a UX choice: it is the mechanism that enables review, reproducibility, and safer execution in environments with mutable state.
Plan Phase: What It Produces
ndeploy plan <project> creates plan artifacts inside the project.
plan.json: full plan with metadata and ordered actions.reports/plan_summary.json: compact summary for fast operator review.- Metadata: source/target instances, root workflow id, generation timestamp.
- Action list for credentials, data tables, and workflows.
- Dependencies for topological ordering.
- Workflow payload snapshots and DEV freshness checksums.
Credentials are handled separately via ndeploy credentials fetch <project>,
ndeploy credentials compare <project>, and
ndeploy credentials merge-missing <project>, which prepares
credentials_manifest.json. Use
ndeploy credentials validate <project> --side manifest --strict before apply.
Action Semantics
| Type | Action | Meaning |
|---|---|---|
| Credential | MAP_EXISTING |
Found by name in PROD; map DEV id to existing PROD id. |
| Credential | CREATE |
Missing in PROD; create a production credential template entry for operator review. |
| Data Table | MAP_EXISTING or CREATE |
Matched by name; schema mismatches generate warnings. |
| Workflow | UPDATE or CREATE |
Depends on whether name already exists in PROD. |
Apply Phase: Runtime Source of Truth
ndeploy apply <project> validates and executes. Runtime state may differ from plan-generation state,
so apply re-checks what must be true before writing.
- Validate plan schema.
- Validate root action existence.
- Validate DEV freshness for workflow payloads.
- Load reviewed credential manifest values from
credentials_manifest.json. - Execute actions in dependency-safe order.
- Patch references with resolved ID mappings before workflow writes.
- Write
reports/deploy_result.jsonandreports/deploy_summary.jsonin the project.
If execution fails mid-run, NDploy still writes partial deploy result files to support incident analysis.
Update Skip Logic
For workflow updates, NDploy compares normalized desired vs normalized current PROD payload.
If equivalent, update is skipped (unless --force-update is set).
UPDATE in plan does not imply an actual write during apply.