Closed bsechter-unext closed 5 years ago
This should be straight-forward. Instead of reading node name from System.get_env
, you should use the built-in node()
method and actually specify the node name to distillery using the appropriate config (--name
or --sname
flags for the commands in general).
See:
I tried to create Distillery release commands, but gave up because the node is not set. Even if I replace the database path or move the files, the database is not usable when the application is started with the proper node name.
There may or may not have been issues with mix commands as well. I did not test them as extensively, but I am using the same base function for both.
Is there a way to create a usable Mnesia database for the node
real_node_name@real_host_name
when the current node isnonode@nohost
in a Distillery release task? Also, being able to batch create Mnesia databases for a list of nodes might be useful, although I do not think that changes anything given a solution for one node.EDIT
I wound up using the following function to set set the node name for the task.
Combined with the following change to the
:mnesia
configuration, release tasks can be used to create databases. This only works for a single node at a time, however.Maybe it is worth adding a note to the documentation?