Umbrella Projects
Umbrella projects are not much different than regular projects with Distillery, but there are a few
small difference worth noting. First, the release configuration generated by Distillery under an
umbrella project will create a default release definition which includes all of the applications in
the umbrella (which were present at the time you ran mix release.init
). If you passed the
--release-per-app
flag, it will generate a separate release definition for each application.
The thing is, you don’t always want the default behaviour, instead you may want to construct two releases,
with different sets of applications in the umbrella, say for a web frontend, and a processing backend. In
this case, you need to modify rel/config.exs
with a release definition for each release you want.
Extending the example I gave above, using apps named :web
, :processing
, and :metrics
, you may want two
releases, one called :frontend
, and one called :backend
, which contain the relevant application, as well
as the standalone :metrics
application for monitoring the performance of each node. This would look like the
following in rel/config.exs
:
...snipped prelude...
release :frontend do
set version: current_version(:web)
set applications: [:web, :metrics]
end
release :backend do
set version: current_version(:processing)
set applications: [:processing, :metrics]
end
That’s all there is to it! You can define many different releases, with arbitrary combinations of applications
as you see fit. To build all releases at once, just run mix release --all
, otherwise use
mix release --name=<release_name>
to build a specific release.