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

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.

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.

release screenshot

Do we need to always specify release name ?

Let’s give a try.

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.

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

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

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