Skip to main content

Module deploy

Module deploy 

Source
Expand description

bynk deploy — provision persistent Cloudflare identity, then publish.

The generated wrangler.toml is deliberately disposable. This module owns the small, committed bynk.deploy.lock ledger and materialises its KV ids into a freshly compiled worker immediately before Wrangler sees it.

The command mints real Cloudflare resources and writes secrets, so it is split by concern rather than kept as one file — following the layout bynk-emit/src/project.rs established: this parent carries the shared imports, the mod declarations, and the re-exports external callers see, while each child opens with use super::*; and documents its own items.

  • config.rs — the generated wrangler.toml / build-output model. (The [env.<name>] block a non-default --env needs is bynk-emit’s wrangler::environment, which apply.rs calls.)
  • graph.rs — the binding graph, the upload order it forces, and the deploy-time contract-skew check.
  • ledger.rs — the committed bynk.deploy.lock: what this project has provisioned, the orphan diff against it, and --prune.
  • pins.rs — a declared foreign caller’s pin (bynk.foreign.toml) and the gate that refuses a build breaking it (I4, #1970).
  • provisioning.rs — every call out to the wrangler CLI.
  • secrets.rs — which secrets a run sets, and where each value comes from.
  • plan.rs — the plan/apply flow that drives all of the above, in plan/’s five children: run, model, keys, skew and messages.

Structs§

DeployOptions
RevertOptions
bynk revert’s options.

Enums§

DeployFormat

Functions§

materialise_deploy_state
Fill a generated worker configuration from the committed deploy ledger. This is shared with bynk dev -- --remote; local dev leaves placeholders alone because Miniflare does not read the Cloudflare namespace id.
materialise_mtls_for_dev
#3513 A: bind a served Worker’s [[mtls_certificates]] by the ids the last deploy of environment recorded, for bynk dev. An mTLS binding has no local simulation, so the development copy runs it on Cloudflare and needs the certificate’s real id, which only a deploy has resolved. Every binding with a recorded link is bound; the message names each that has none (Err), for the caller to report and carry on: a call through it then fails, naming it. Ok(false) when the Worker declares no certificate.
revert
bynk revert.
run
Run the slice-0 single-context deployment pipeline.