distillery v0.6.0 Mix.Releases.Config

Responsible for parsing the release configuration file.

Summary

Functions

Reads and validates a configuration file. file is the path to the configuration file to be read. If that file doesn’t exist or if there’s an error loading it, a Mix.Releases.Config.LoadError exception will be raised

Macros

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

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

Functions

read!(file)

Reads and validates a configuration file. file is the path to the configuration file to be read. If that file doesn’t exist or if there’s an error loading it, a Mix.Releases.Config.LoadError exception will be raised.

validate!(config)

Macros

current_version(app)

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)

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
release(name, list)

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)

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