distillery v2.1.1 mix distillery.release View Source

Build a release for the current mix application.

Command line options

  • --name - selects a specific release to build
  • --env - selects a specific release environment to build with
  • --profile - selects both a release and environment, syntax for profiles is name:env

Releases and environments are defined in rel/config.exs, created via distillery.init. When determining the name and environment to use, refer to the definitions in that file if you are not sure what options are available.

  • --erl - provide extra flags to erl when running the release, expects a string
  • --dev - this switch indicates whether to build the release in "dev mode", which symlinks build artifacts into the release rather than copying them, both significantly speeding up release builds, as well as making it possible to recompile the project and have the release pick up the changes without rebuilding the release.
  • --silent - mutes all logging output
  • --quiet - reduce logging output to essentials
  • --verbose - produce detailed output about release assembly
  • --no-tar - skip packaging the release in a tarball after assembly
  • --warnings-as-errors - treat any release-time warnings as errors which fail the build
  • --no-warn-missing - ignore any errors about missing applications

Upgrades

You can tell Distillery to build an upgrade with --upgrade.

Upgrades require a source version and a target version (the current version). Distillery will automatically determine a source version by looking at previously built releases in the output directory, and selecting the most recent. If none are available, building the upgrade will fail. You can specify a specific version to upgrade from with --upfrom, which expects a version string. If the selected version cannot be found, the upgrade build will fail.

Executables

Distillery can build pseudo-executable files as an artifact, rather than plain tarballs. These executables are not true executables, but rather self-extracting TAR archives, which handle extraction and passing any command-line arguments to the appropriate shell scripts in the release. The following flags are used for these executables:

  • --executable - tells Distillery to produce a self-extracting archive
  • --transient - tells Distillery to produce a self-extracting archive which will remove the extracted contents from disk after execution

Usage

You are generally recommended to use rel/config.exs to configure Distillery, and simply run mix distillery.release with MIX_ENV set to the Mix environment you are targeting. The following are some usage examples:

# Builds a release with MIX_ENV=dev (the default)
mix distillery.release

# Builds a release with MIX_ENV=prod
MIX_ENV=prod mix distillery.release

# Builds a release for a specific release environment
MIX_ENV=prod mix distillery.release --env=dev

The default configuration produced by distillery.init will result in mix distillery.release selecting the first release in the config file (rel/config.exs), and the environment which matches the current Mix environment (i.e. the value of MIX_ENV).

Link to this section Summary

Functions

A task needs to implement run which receives a list of command line args.

Link to this section Functions

A task needs to implement run which receives a list of command line args.

Callback implementation for Mix.Task.run/1.