Deployment
Using without Releases
It's recommended to create an escript or mix task to perform the Realbook operations. Guidelines for this process will be forthcoming.
Deployment using Mix Releases
With scripts in a generic location.
- Create an entrypoint function (e.g.
MyApp.go/1
). Let's say this function takes the:script_dir
as a parameter and sets that application, then launches the script(s) - Upload your scripts (and assets) to your provisioning server (for
example
~/my_scripts
) - Perform a release and transfer your application to the provisioning server.
- Execute the realbooks.
> path/to/release/my_app eval 'MyApp.go "~/my_scripts"'
With scripts and assets in the priv/ directory
store your scripts and assets in, for example
priv/scripts
andpriv/assets
create an entrypoint function that sets
:script_dir
as follows:script_dir = :my_app |> :code.priv_dir |> Path.join("scripts") Application.put_env(:realbook, :script_dir, script_dir)
repeat with
:assets_dir
Perform a release and transfer the application to the provisioning server.
Execute the realbooks.
> path/to/release/my_app eval 'MyApp.go'
The advantage to the latter method is that it allows you to package your scripts with your deployment. If for some reason you want to keep them separate, (for example, if they are shared in a repo between multiple projects) then you should use the former method.