distillery v1.2.0 Mix.Releases.Overlays

This module is responsible for applying overlays to a release, prior to packaging. Overlays are templated with EEx, with bindings set to the values configured in overlay_vars.

There are some preconfigured overlay variables, namely:

  • erts_vsn: The version of ERTS used by this release
  • release_name: The name of the current release
  • release_version: The version of the current release

For example, given a release named my_release, version 0.1.0:

{:mkdir, "releases/<%= release_version %>/foo"}

The above overlay will create a directory, rel/my_release/releases/0.1.0/foo. Overlay input paths are relative to the project root, but overlay output paths are relative to the root directory for the current release, which is why the directory is created in rel/my_release, and not in the project root.

Summary

Functions

Applies a list of overlays to the current release. Returns {:ok, output_paths} or {:error, details}, where details is one of the following

Functions

apply(output_dir, overlays, overlay_vars)
apply(String.t, [overlay], Keyword.t) ::
  {:ok, [String.t]} |
  error

Applies a list of overlays to the current release. Returns {:ok, output_paths} or {:error, details}, where details is one of the following:

  • {:invalid_overlay, term} - a malformed overlay object
  • {:template_str, desc} - templating an overlay parameter failed
  • {:template_file, file, line, desc} - a template overlay failed
  • {:overlay_failed, term, overlay} - applying an overlay failed
template_file(path, overlay_vars)
template_file(String.t, Keyword.t) ::
  {:ok, String.t} |
  {:error, {:template, term}}
template_str(str, overlay_vars)
template_str(String.t, Keyword.t) ::
  {:ok, String.t} |
  {:error, {:template_str, term}}