Versions and deployments
On your machine, mk dev installs your game on the dev server. For players, the same bundles go to the servers of a Connect network, wherever those servers run. Each server swaps the new code in while players stay connected, as the dev server does.
Versions and deployments
Section titled “Versions and deployments”The model follows Cloudflare Workers versions and deployments, with label selectors instead of shares of traffic:
| Cloudflare Workers | Minekube Games |
|---|---|
| A version is a fixed state of code and settings. | A version is the bundles of one build. Its id is the hash of its bundles, so the same bundles are the same version. |
| A deployment says which versions get traffic, at most two with a share each. | A deployment points a label selector at a version. A network can have any number of them side by side. |
| A version key keeps a user on one version. | A server runs exactly one version per bundle, so all players on a server see the same game. |
wrangler deploy, wrangler rollback |
mk deploy, mk rollback |
A server runs the bundles of every deployment whose selector matches its labels. Where two deployments have a bundle of the same name, the newer one wins. Each server takes the bundles for its own platform: a Paper server the game, a Velocity proxy the proxy bundle.
Who decides what
Section titled “Who decides what”| Where | What |
|---|---|
The project, in vite.config.ts |
The bundles, and the targets they go to: a network and a selector each |
The server, in connector.json |
Its labels, such as channel=canary, its key and the network it joins |
The network, with mk network and mk trust |
Its owner, invites and trust rules |
The server says what it is. The project says which servers it targets.
Local first
Section titled “Local first”Every command talks to the Minekube API. By default that is the Minekube API on your machine, mk api on http://localhost:4776, which runs the same code as Minekube’s. Point a project at another one with api in vite.config.ts, the MINEKUBE_API environment variable or --api: Minekube’s, staging, or one you host yourself.
- Create a network and log in: Create a network, in Connect.
- Let servers in with an invite, a trust rule, or your dev server: Let servers in, in Connect.
- Name your bundles and targets in
vite.config.ts: Vite plugin and configuration. - Deploy a version to the servers a target’s selector picks: Deploy a version.
- Roll back and undeploy: Roll back and undeploy.
- How a server gets its bundles: How servers get their bundles.
- What comes next: the planned pages below.
- Vite plugin and configurationPreview
A project declares its bundles, the Paper and Velocity versions they are built for, and its deploy targets in vite.config.ts with the minekube() plugin. One core serves vite and mk - vite build writes dist/ with minekube.json, vite dev installs on every save, and mk deploy uploads dist/.
- Deploy a versionPreview
Build your project with Vite and roll it out to the servers a target's label selector picks in a Connect network, with mk deploy. Each server swaps the new version in while players stay connected.
- Change the platform versionPreview
Move a Minekube project to another Paper or Velocity version on purpose - edit vite.config.ts, regenerate the types with mk types, let the type check show what broke, restart the dev server, and deploy with a check of the servers' versions.
- Roll back and undeployPreview
Point a target back at the version it ran before, or at any earlier version, with mk rollback, and end a target's deployment with mk undeploy.
- How servers get their bundles
How a deployed version reaches a server - bundles stored by their hash, a desired state per server in the network's Durable Object, the connector syncing files, and the Minekube plugin swapping them in.
- Controlled updatesPlanned
Planned: a game holds an update while a round runs, servers report what they run so routing can send new players elsewhere, and a rollout goes in waves that stop when a server cannot run the new revision.
- Hostnames and custom domainsPlanned
Planned: a target names hostnames under its network, such as arena.my-network.g.minekube.net, and custom domains that players reach through a CNAME after the Minekube API has checked that the domain is yours.
- Platform updatesPlanned
Planned: mk update installs the newest CLI after checking its hash against the release manifest, and /minekube update fetches the newest Minekube plugin into the server's update folder, on any setup.
Was this helpful?
Thanks for the feedback.