I have an umbrella app generated with Phoenix 1.3.0-rc.2
, in which I currently have one app intended to be run on its own server with its own database; this child app is very simple and will act as an HTTP API and data store, and the other apps, one of which I plan to have read data from the first child app, will come later.
As per Distillery’s Phoenix walkthrough, I have this in the child app’s config/prod.exs
:
config :my_child_app, MyChildApp.Web.Endpoint,
# ...
version: Mix.Project.config[:version]
In the umbrella app’s rel/config.exs
:
release :my_child_app do
set version: current_version(:my_child_app)
end
However, in the resultant release’s sys.config
I get {version,nil},
.
If I add a version
key (which wasn’t there in the files generated with phx.new
) to the umbrella parent app’s project
function’s list, sys.config
gets the version value from it.
def project do
[apps_path: "apps",
start_permanent: Mix.env == :prod,
deps: deps(),
version: "0.0.1"]
end
When I run iex -S mix
from the umbrella’s root and then the child app’s directory, I get the same results as seen above when doing Mix.Project.config[:version]
.
Is this expected/okay, or should Distillery be using the version from the child app when it generates sys.config
? Should I make sure that sys.config
always has a non-nil version value?
Distillery’s Phoenix walkthrough says:
version
ensures that the asset cache will be busted on versioned application upgrades (more on this later)