Releases
Build a release and an image, run commands in it, and cut a version.
Every node runs one Elixir release named cardinal. A release has no Mix, so the cardinal CLI is not inside it. You run its commands with bin/cardinal eval.
Build a release from a workspace
cd acme
cardinal build --target release
_build/prod/rel/cardinal/bin/cardinal eval 'IO.write(CardinalCore.Native.add(40, 2))'
# 42cardinal build --target release checks every app, builds the desk and the app desk plugins, writes build/build.json with each app's version and git pin, then runs mix deps.get --only prod, mix deps.compile and mix release with MIX_ENV=prod.
From a plain checkout, MIX_ENV=prod mix release in platform/ builds the release with core only.
Build an image
Make the build context. It holds this checkout, a fresh workspace with the app at REF after cardinal build, and its Dockerfile:
scripts/workspace-ctx.sh /tmp/ctx git@github.com:revaik-org/erp-cardinal.git REFCopy /tmp/ctx to the server and build there, on the server's own CPU architecture:
docker build -t cardinal-erp:latest .The image holds the release, the desk bundle, the website bundle and the apps' desk bundles. A shared Rust stage builds both the NIF and the desk's WASM module. The image runs as uid 10001 on a root-owned tree with RELEASE_TMP=/tmp, so it works with a read-only root and a tmpfs on /tmp. Erlang distribution is off, so there is no remote shell.
The repo's own deploy/Dockerfile builds the same image for the e2e stack, with CARDINAL_DEV_BUILD=1.
Release commands
Run them in a container from the image:
docker compose -f docker-compose.prod.yml run --rm web bin/cardinal eval 'CardinalCore.Release.migrate()'| Function | Does |
|---|---|
CardinalCore.Release.migrate() | cardinal migrate -t all: the platform schema, then every active site. Raises on the first site that fails and names it |
CardinalCore.Release.new_site(host, admin_email \\ nil) | cardinal new-site: unclaimed, or claimed for admin_email with CARDINAL_ADMIN_PASSWORD. Leaves an existing host alone |
CardinalCore.Release.seed(host, apps \\ :all) | Create host with the apps and finish setup with admin@<host> as System Manager. The e2e stack uses it |
CardinalCore.Release.meta_check() | cardinal meta check. Exits 1 on an error |
CardinalCore.Services.TenantService.create(host, admin, install_apps: [...]) | Create a claimed site with apps, as in Deploy |
Versions
Cardinal's version history is CHANGELOG.md, in Keep a Changelog format. Versions so far are 0.1.0-alpha.1 to 0.1.0-alpha.5.
Move the ## [Unreleased] entries under a heading such as ## [0.1.0-alpha.6] - 2026-11-30.
Promote main to staging, then to production, through pull requests.
The push to production runs release.yml, which calls scripts/release.sh. It tags the newest version as v<version> and publishes a GitHub release, a pre-release when the version has a hyphen. A version already released is skipped.
scripts/release.sh --notes prints the notes without publishing. cardinal self-update follows the production branch by default, so a developer checkout gets each release.