[erlang-questions] Release upgrade of an app without a top supervisor
Roberto Ostinelli
roberto@REDACTED
Tue Feb 16 16:28:57 CET 2016
If anyone else needs a solution for this, here is mine.
First, build your release upgrade package as you normally would. I use
rebar, so I issue:
$ rebar generate-appups previous_release=myapp-1.4.6
Modify your .appup files as needed, then generate the upgrade package:
$ rebar generate-upgrade previous_release=myapp-1.4.6
Then, open up the upgrade package, and look for the relup file
releases/1.5.0/relup.
In your relup instructions, before the point_of_no_return instruction
ensure to load the setup app:
{load_object_code,{setup,"1.5.0",[setup,setup_gen,setup_lib]}},
Just after the point_of_no_return, ensure to stop it:
{apply,{application,stop,[setup]}},
Finally, after all the other instructions ensure to start it:
{apply,{application,start,[setup,permanent]}}
Now, on a live system, check which applications are live:
1> application:which_applications().
[{myapp,"My App.","1.4.6"},
{exometer_core,"Code instrumentation and metrics collection package.",
"1.4.6"},
{setup,"Generic setup application for Erlang-based systems","1.4.6"},
Then proceed to the normal upgrade:
2> release_handler:unpack_release("myapp_1.5.0").
3> release_handler:install_release("1.5.0").
4> release_handler:make_permanent("1.5.0").
Check applications again:
5> application:which_applications().
[{setup,"Generic setup application for Erlang-based systems","1.5.0"},
{myapp,"My app.","1.5.0"},
{exometer_core,"Code instrumentation and metrics collection package.",
"1.5.0"},
You can see that it upgraded successfully.
Hope this can help somebody else.
Best,
r.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160216/da86fa34/attachment.htm>
More information about the erlang-questions
mailing list