Local builds, dependency management, and Elixir release builds. Owns the build parent subcommand; container-image and chart-publish steps are contributed by other plugins that extend the same parent (Marea.Plugins.Docker for build docker / build show-dockerfile / build show-docker-versions, Marea.Plugins.Helm for build helm).

Always loaded (part of @base_plugins).

Every build leaf is also exposed as an MCP tool via marea mcp servebuild_clean, build_local, build_deps, build_release, plus build_docker and build_helm when their plugins are loaded. Builds are long-running but non-interactive; their stdout/stderr are captured and returned as the MCP tool result.

Commands

marea build
 clean      --mix-env <env>
 local      --mix-env <env>
 deps       --app <name|--all> --mix-env <env>
 release    --deploy <d> --release <r> --mix-env <env> [--run]

--deploy and --release default to the most recently used values (persisted in <state_dir>/last_values).

marea build clean

Removes <state_dir>/build and <state_dir>/last_values. Useful before a clean rebuild or to reset the deploy/release defaults.

marea build local

Runs MIX_ENV=<env> mix deps.get && mix compile. The default --mix-env is dev. Honours cmd_prefix.build.

marea build deps --app <name>

Updates one (or all, with --app --all) dependencies and re-runs mix deps.get for the chosen MIX_ENV. Convenience for keeping mix.lock consistent with what the docker build will use.

marea build release

Runs mix release <release> --overwrite for the deploy/release pair, and prints a summary table:

MIX_ENVdeployreleasevsn
prodstagingapi2026_05_06-…-abcdef1

The release version comes from the Marea.Plugins.Base.marea_release_vsn/0 callback — the default implementation is <date>-<git-sha>.

If --run is passed, Marea immediately delegates to Marea.Plugins.Run.run_cmd([:release], …) so that you build and start the release in one go.

The build calls Lib.update_git!/0 after mix release to commit any mix.lock change automatically — keeping the deployed image reproducible from a clean git ref.

Public helpers

  • build/2 — runs mix release for the active deploy/release, prints the BUILD <target> table, updates git, and stashes target and git_vsn into config.values. Public so plugins that compose multi-step builds can reuse the release step. Both marea build docker (in Marea.Plugins.Docker) and marea build helm (in Marea.Plugins.Helm) start with a call to it.

Source