distillery v0.6.0 Mix.Releases.Plugin behaviour
This module provides a simple way to add additional processing to phases of the release assembly and archival.
You can define your own plugins using the sample definition below. Note that
defmodule MyApp.PluginDemo do
use Mix.Releases.Plugin
def before_assembly(%Release{} = release) do
info "This is executed just prior to assembling the release"
end
def after_assembly(%Release{} = release) do
info "This is executed just after assembling, and just prior to packaging the release"
end
def after_package(%Release{} = release) do
info "This is executed just after packaging the release"
end
def after_cleanup(_args) do
info "This is executed just after running cleanup"
end
end
A couple things are imported or aliased for you. Those things are:
- The
Mix.Releases.Release
struct is aliased for you to just Release debug/1
,info/1
,warn/1
,notice/1
, anderror/1
are imported for you. These should be used to do any output for the user.
before_assembly/1
and after_assembly/1
will each be passed a Release
struct,
containing the configuration for the release task, after the environment configuration
has been merged into it. You can choose to return the struct modified or unmodified, or not at all.
In the former case, any modifications you made will be passed on to the remaining plugins and then
used during assembly/archival.
The required callback after_cleanup/1
is passed the command line arguments. The return value is not used.
Summary
Functions
Loads all plugins in all code paths