distillery v2.1.1 Distillery.Releases.Config View Source
Responsible for parsing the release configuration file.
Link to this section 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.
Plugins will be called in the order they are defined. In the example
below MyApp.ReleasePlugin
will be called, then MyApp.MigratePlugin
Reads and validates a given configuration file.
If the file does not exist, or an error occurs, a Distillery.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 Distillery.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.
Validates a %Config{}
struct.
If the struct is not valid, an ArgumentError
is raised. If valid, returns true
.
Link to this section Types
Link to this section Functions
current_version(app) View Source (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) View Source (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 \\ []) View Source (macro)
Adds a plugin to the environment or release definition it is part of.
Plugins will be called in the order they are defined. In the example
below MyApp.ReleasePlugin
will be called, then MyApp.MigratePlugin
Usage
release :myapp do
plugin MyApp.ReleasePlugin
plugin MyApp.MigratePlugin
end
read!(file) View Source
Reads and validates a given configuration file.
If the file does not exist, or an error occurs, a Distillery.Releases.Config.LoadError
will be raised.
read_string!(contents) View Source
Reads and validates a string containing the contents of a config file.
If an error occurs during reading, a Distillery.Releases.Config.LoadError
will be raised.
release(name, list) View Source (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]
end
set(opts) View Source (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)
View Source
validate!(Distillery.Releases.Config.t()) :: true | no_return()
validate!(Distillery.Releases.Config.t()) :: true | no_return()
Validates a %Config{}
struct.
If the struct is not valid, an ArgumentError
is raised. If valid, returns true
.