Gamend.Hooks.PluginBuilder (gamend_core v1.0.1192)

Copy Markdown View Source

Builds an OTP plugin bundle from plugin source code on disk.

This is intended for admin-only workflows in development/self-hosted setups. It runs mix commands on the server host/container.

Summary

Functions

Whether this image can build plugin bundles at all.

Types

build_result()

@type build_result() :: %{
  ok?: boolean(),
  plugin: String.t(),
  source_dir: String.t(),
  started_at: DateTime.t(),
  finished_at: DateTime.t(),
  steps: [step_result()]
}

step_result()

@type step_result() :: %{
  cmd: String.t(),
  status: non_neg_integer(),
  output: String.t()
}

Functions

available?()

@spec available?() :: boolean()

Whether this image can build plugin bundles at all.

The build shells out to mix, which a release image built from Dockerfile.release does not ship: it carries compiled .beam files and no build toolchain. Callers check this so an image without Mix presents a disabled control with a reason, instead of three System.cmd/3 calls that fail on :enoent and surface as a build error.

build(plugin_name)

@spec build(String.t()) :: {:ok, build_result()} | {:error, term()}

list_buildable_plugins()

@spec list_buildable_plugins() :: [String.t()]

sources_dir()

@spec sources_dir() :: String.t()