Skip to content
Get started

Publish a revision

View as Markdown

mk publish takes your game from your machine to the servers of a network. It builds the project the way mk dev does, uploads its bundles as a revision, and assigns the revision to a label selector.

Before you start: you need a network with at least one server in it. See Create a network and Let servers in in Connect. During the preview, set MINEKUBE_REGISTRY=https://registry.staging.minekube.net.

In your project:

Terminal window
mk publish --network my-network

Without a selector, every server of the network runs the revision. The revision is named by the hash of its bundles, so publishing the same code twice makes no new revision.

Pass a selector with -l:

Terminal window
mk publish --network my-network -l channel=canary

Every server whose labels match runs the revision. A label comes from the server itself, in its connector.json, or from the invite or trust rule that let it in. A canary is a set of servers labelled channel=canary, so you try a revision there first and then publish it to everyone.

Each server’s connector gets the new assignment, downloads the bundles it does not have, and the Minekube plugin swaps the game in. Players stay connected. On the server, the log says Reloaded <id> (<revision>).

mk revisions --network my-network shows what runs where, since when and by whom.

Was this helpful?