Skip to main content

Instance Configuration

Each Allegro deploy builds one worker bundle and records it as an edge release. When automatic deploys are on, a new release is rolled out to every organization that opted in.

Environment Variables​

VariableDefaultDescription
EDGE_AUTO_DEPLOYfalseLets new releases, settings changes, and the nightly retry deploy workers on their own. Set true in production only.
EDGE_BUNDLE_PATHpackages/allegro-edge/worker/dist/manifest.jsonWhere the built worker bundle is read from. The default matches the build output; you rarely need to set it.

The Cloudflare OAuth client variables (EDGE_CLOUDFLARE_*) are covered in Cloudflare OAuth for Edge.

Keep auto deploy off outside production

With EDGE_AUTO_DEPLOY on, an instance pushes to the customer's real Cloudflare account. Leave it off on local and staging instances so they never overwrite a production worker.

What EDGE_AUTO_DEPLOY Controls​

ActionAuto deploy offAuto deploy on
A new release is recordedRecorded, not deployedDeployed to every opted-in property
An organization connects CloudflareNothing deployedDeploys its Edge-enabled properties
A property's Edge settings changeNothing changes in CloudflareRedeploys, or removes routes when Edge is turned off
Nightly retry of failed deploys (04:00)SkippedRetries each property whose last deploy failed
Deploy now and Roll back on a propertyWorkWork

Build Step​

The root npm run build (and npm run build:ssr) finishes with npm run edge:bundle. That runs a Wrangler dry-run upload of the worker and writes packages/allegro-edge/worker/dist/manifest.json, which holds the bundled modules, the worker metadata, and a content hash. The hash identifies the release: it changes only when the worker code or its Wrangler config changes.

The bundle is a build artifact and is not committed. Every server that runs queue workers needs the same build, because deploy jobs upload the bundle from local disk.

Release Step​

The Composer deploy script runs php artisan edge:release after migrations. The command:

  1. Reads the bundle at EDGE_BUNDLE_PATH. If it's missing, it warns and exits successfully so the app deploy is not blocked.
  2. Records the bundle hash as an edge release, once per hash.
  3. When the hash is new and EDGE_AUTO_DEPLOY is on, queues a rollout to every organization.

The rollout runs on the bulk queue. Each property's deploy job carries the release hash; if it lands on a queue worker that still has the previous bundle (old workers are draining during an app deploy), it requeues itself until a worker with the new bundle picks it up. A property whose worker already runs the release with the same configuration is skipped.