Quick Glance @ Elixir 1.9 Releases feature

New mix task for Elixir releases

Created Using Canva.com

This article is all about showing the live demo of Elixir Releases, a brand new mix task .

Mix Task Commands

MIX_ENV=prod mix release
MIX_ENV=prod mix release release_name

The above commands will generate a self-contained releases.

What is self-contained?

  1. No Source Code is required
  2. Not require Erlang or Elixir.
  3. Loads only required Elixir and Erlang Libraries instead all
  4. Includes Erlang VM(Virtual Machine)

Live Demo

Project Creation

Let’s create a new project for demonstration.

mix new hello

Basic Release Configuration

A release can be configured in our file under the key inside :

To keep it tidy, I created a new private function .

How to run a release?

You just need to specify the name. Here is our new release name.

The above configuration is enough to release our application for demo purpose.

MIX_ENV=prod mix release demo
release screenshot

Do we need to always specify release name ?


Let’s give a try.

MIX_ENV=prod mix release 

Still works ‼️

As we are having only one configuration for release.

What happens if there are more than one (1) configurations ?

❌ ❌


Let’s check it.

I just updated the function by adding another configuration . Check the following screenshot

file: mix.exs

Now run the task without specifying the release name.

MIX_ENV=prod mix release

1.9.0 Release BUG 🐞

Specifying Default Release option :default_release

Though they mentioned to set option in our project root configuration, there is a bug in the recent release where the default setting was never read . Hope to get it fixed in the coming release.

Can we change the default release directory?


Just add

path: "your path"

option to the release configuration like in the following screenshot

Now run the release . All the releases will move to folder in the project.

You can see a lot of information logs to the console while you run the release. Though it is informative, sometimes it looks weird.

We can provide the

quiet: true

option to simply run the release with out any verbose.

Check out the following screenshot for adding the option.

I purposely added two configurations, with and without option like below

Now run both releases and see the difference.

The left side is with and right side without option.

There are lot things to read about releases for better usage.

This is just a glance of releases in Elixir 1.9.0. For Better understanding and in depth reading check →Elixir mix release.

Hope you liked it.

Thanks for reading.

Join Our Telegram Channel and support us.

Check out the GitHub repository on Killer Elixir Tips

Glad if you can contribute with a ★

coding, thoughts & ideas