Skip to main content

Module deploy

Module deploy 

Source
Expand description

High-level deploy orchestration — the engine behind krypt link / krypt unlink / krypt relink.

Stages of a link:

  1. Load .krypt.toml (with include = [...] expansion).
  2. Build a Resolver (optionally pinned to a non-host Platform for testing).
  3. Apply [paths] overrides from the config.
  4. Build a [Plan].
  5. Load the existing Manifest (if any).
  6. Narrow conflicts: for each Action::Conflict in the plan, check the manifest — if the recorded hash_dst matches the current file on disk, the destination is “ours” and a re-deploy is safe; promote to a Action::Copy. If force is set, promote everything.
  7. Execute the plan.
  8. Update the manifest with what was written, save atomically.

unlink is the inverse: iterate the manifest, hash each dst, delete only entries that still match the recorded hash (i.e. haven’t drifted). With force, delete regardless of drift.

relink = unlink + link.

Structs§

DeployOpts
Knobs for link / unlink / relink.
LinkReport
Summary returned by link.
UnlinkReport
Summary returned by unlink.

Enums§

DeployError
Anything that can go wrong during a deploy.

Functions§

link
Deploy every entry in the config. Idempotent — re-runs over a clean state make no changes.
relink
Convenience: unlink followed by link. Useful after large config edits where you want a clean redeploy.
unlink
Remove every entry recorded in the manifest. Drifted destinations are skipped unless force is set.