distillery v2.0.8 Mix.Releases.Overlays View Source

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.

Link to this section 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

Link to this section Functions

Link to this function apply(output_dir, overlays, overlay_vars) View Source
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
Link to this function template_file(path, overlay_vars) View Source
Link to this function template_str(str, overlay_vars) View Source