I am running my Elixir project's CI on SnapCI and I cache my deps folder so that it does not have to install my deps every time it tries to run my tests. How do I do that ?
I noticed that there is an env setting for DEPS_DIR
but that seems to be a rebar thing, or is it the same ? In any event, I tried that on a simple project I have but it does not seem to work and mix
still install my deps in my current folder.
Update March 4th 2015
Here is my full script for snap-ci:
curl -O https://raw.githubusercontent.com/spawngrid/kerl/master/kerl && chmod a+x kerl
mkdir -p /var/go/deps
export MY_DEPS_PATH=/var/go/deps
set +e
./kerl update releases
./kerl cleanup 17.4
(./kerl list builds | grep 17.4) || (export MAKEFLAGS='-j3'; ./kerl build git https://github.com/erlang/otp/ OTP-17.4 17.4)
(./kerl list installations | grep 17.4) || (./kerl install 17.4 ~/.kerl/installs/17.4)
source ~/.kerl/installs/17.4/activate
mkdir -p vendor/elixir
wget --no-clobber -q https://github.com/elixir-lang/elixir/releases/download/v1.0.2/precompiled.zip
unzip -o -qq precompiled.zip -d vendor/elixir
export PATH=`pwd`/vendor/elixir/bin:$PATH
yes y | MIX_ENV=test mix do local.rebar
yes y | MIX_ENV=test mix deps.get
yes y | MIX_ENV=test mix deps.compile
MIX_ENV=test mix amrita --trace
In umbrella projects, there's a "deps_path" option used. You can use any local directory here (see [1]).
You must decide yourself if it's a good solution for your situation. If you didn't specify precise version of every dep, you would get different outcome in CI (with cached deps) and in a standalone compilation. Of course you can combine both.
[1] http://elixir-lang.org/getting-started/mix-otp/dependencies-and-umbrella-apps.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With