distillery v1.2.0 Mix.Releases.Config

Responsible for parsing the release configuration file.

Summary

Functions

Gets the current version of the given app and returns it as a string. If the app cannot be loaded, an error is raised. Intended to be used in conjunction with setting the version of a release definition, as shown below

Creates a new environment for building releases. Within an environment, you can set config options which apply to all releases built in that environment

Adds a plugin to the environment or release definition it is part of

Reads and validates a given configuration file. If the file does not exist, or an error occurs, a Mix.Releases.Config.LoadError will be raised

Reads and validates a string containing the contents of a config file. If an error occurs during reading, a Mix.Releases.Config.LoadError will be raised

Creates a new release definition with the given name. Within a release definition, you can set config options specific to that release

Set a config option within an environment or release definition. set takes a keyword list of one or more values to apply. An error will be raised if set is used outside of an environment or release definition, or if the config value being set does not exist

Types

t()
t() :: %Mix.Releases.Config{default_environment: atom, default_release: atom, environments: Map.t, is_upgrade: boolean, releases: Map.t, selected_environment: atom, selected_release: atom, upgrade_from: :latest | String.t}

Functions

current_version(app) (macro)

Gets the current version of the given app and returns it as a string. If the app cannot be loaded, an error is raised. Intended to be used in conjunction with setting the version of a release definition, as shown below.

Usage

release :myapp do
  set version: current_version(:myapp)
end
environment(name, list) (macro)

Creates a new environment for building releases. Within an environment, you can set config options which apply to all releases built in that environment.

Usage

environment :dev do
  set dev_mode: true
  set include_erts: false
end
plugin(name, opts \\ []) (macro)

Adds a plugin to the environment or release definition it is part of.

Usage

release :myapp do
  plugin MyApp.ReleasePlugin
end
read!(file)
read!(String.t) :: Config.t | no_return

Reads and validates a given configuration file. If the file does not exist, or an error occurs, a Mix.Releases.Config.LoadError will be raised.

read_string!(contents)
read_string!(String.t) :: Config.t | no_return

Reads and validates a string containing the contents of a config file. If an error occurs during reading, a Mix.Releases.Config.LoadError will be raised.

release(name, list) (macro)

Creates a new release definition with the given name. Within a release definition, you can set config options specific to that release

Usage

release :myapp do
  set version: "0.1.0",
  set applications: [:other_app]
  set code_paths: ["/some/code/path"]
end
set(opts) (macro)

Set a config option within an environment or release definition. set takes a keyword list of one or more values to apply. An error will be raised if set is used outside of an environment or release definition, or if the config value being set does not exist.

Usage

environment :dev do
  set dev_mode: true
end
validate!(config)
validate!(Mix.Releases.Config.t) :: true | no_return