Custom commands are extensions to the boot script, and are used in the same
way you use
remote_console, in other words, they have the
appearance of being part of the boot script. Like hooks, they have access to
the boot scripts helper functions and environment.
Given a config like the following:
use Mix.Releases.Config environment :default do set commands: [ echo: "rel/commands/echo" ] end release :myapp do set version: current_version(:myapp) end
And the command script under
When you build your release, you can then call your command like so:
> _build/dev/rel/myapp/bin/myapp echo hi hi
You have access to anything defined in the boot script’s environment, see Shell Script API for details.