A word of explanation

Some of you are not familiar with CircleCI whatsoever so it may be confusing as you can see in the Reddit thread:

Thanks for the explanation!

CircleCI 1.0 is way more easy to set up with out of the box solutions

is way more easy to set up with out of the box solutions CircleCI 2.0 seems to be harder to implement but offers better flexibility at the same time with more possibilities and configuration options

Configuration

In order to execute Elixir on your CircleCI container (e.g. run tests or build some artifacts) you need to cover the following steps:

Set MIX_ENV variable

variable Set system PATH

Cache particular directories

Define Erlang and Elixir versions

and versions Install Erlang and Elixir themselves

Let’s describe them briefly now.

circle.yml

In the configuration file there are a couple of entries you need to add. They are described by inline comments here.

We need to make sure that particular environmental variables are set, we install all dependencies and compile the entire project. To speed up everything, we also cache some directories. Once everything is done, we lint the files and run all tests.

Tools

To install Elixir and Erlang we use a great tool called asdf. It’s an extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more.

Plugins are how asdf understands how to handle different packages and .tool-versions file defines the versions of tools to be installed.

As you can see, we used erlang and elixir plugins. We also defined the newest version of these tools (at the time of writing).

To speed up the entire process, we leverage caching and check if adsf is already installed. Then, the tool itself verifies installation of plugins and doesn’t fetch them if they exist.

Subscribe to get the latest content immediately

https://tinyletter.com/KamilLelonek

Summary