Automatically generate the .appup files from the beam file.
- Support the multiple versions upgrade and downgrade.
- You can define the extra and original code_change functions.
$ rebar3 help erlup appup # using rebar3.
$ erlup appup -h # using escript.
%% rebar.config
{erlup, [{appup, Configs}]}.
%% erlup.config
{appup, Configs}.
When the term()
to specify the following atom
, it use the actual value.
'$from'
: The version of the old release (it isn't the version of application)'$to'
: The version of the new release'$from_vsn'
: The version of the old application (there is thevsn
in the.app
file)'$to_vsn'
: The version of the new application
If changed module export the given function, the function is executed at the time of the upgrade / downgrade.
In the case of upgrade, it will be executed after the module has been loaded.
In the case of downgrade, it will be executed before the module has been loaded.
So, it runs on the always new module.
{appup, [{applies,
[
{Function :: atom(), UpArgs :: [term()], DownArgs :: [term()]}
]}
]}.
Length of UpArgs
and DownArgs
MUST be the same.
Function
MUST NOT use code_change
and system_code_change
.
It specifies the update order of the module.
{appup, [{deps,
[
{Mod :: module(), ModDeps :: [module()]}
]}
]}.
Load the ModDeps
before loading the Mod
.
It specifies the Extra that is argument of code_change and system_code_change.
{appup, [{extra, {UpExtra :: term(), DownExtra :: term()}}]}.