Hi all,
Recently, I’ve been acquainting myself with Distillery for deployment, where I am currently deploying both production and development releases for my application to the server. For this, I am using the following configuration file:
Path.join(["rel", "plugins", "*.exs"])
|> Path.wildcard()
|> Enum.map(&Code.eval_file(&1))
use Mix.Releases.Config,
default_release: (if Mix.env() === :prod, do: :app_name, else: :app_name_dev),
default_environment: Mix.env()
environment :dev do
set dev_mode: true
set include_erts: true
set cookie: :"${ERLANG_COOKIE_DEV}"
end
environment :prod do
set include_erts: true
set include_src: false
set cookie: :"${ERLANG_COOKIE_PROD}"
end
release :app_name do
set version: current_version(:app_name)
set applications: [
:runtime_tools
]
end
release :app_name_dev do
set version: current_version(:app_name)
set applications: [
:runtime_tools,
:app_name
]
end
I am, however, having problems understanding how I can make a new release for both the production application (:app_name
) and the development application (:app_name_dev
) with the same version. After generating the production and development releases, they both end up in the _build
directory, but after updating one release, I cannot update the other release without the following error:
==> Invalid appup specification, mismatched versions found:
version: previous
expected: 0.0.3
got: 0.0.4
I think creating two separate builds entirely will fix the problem, but it seems like an additional inconvenience. Does anyone have any advice on how to best do this?
Thanks,
Tom