Elixir mixes automatic confirmation

I want to run tests of my Phoenix application on Travis-CI.

Excerpt from the journal:

$ MIX_ENV=test mix do deps.get, compile, test Could not find hex, which is needed to build dependency :phoenix Shall I install hex? [Yn] 

When it comes to getting and installing dependencies, it asks if it should install hex . I was wondering if I can pass the --yes parameter for mixing so that it doesn’t ask, but just install?

+8
elixir hex travis-ci mix
source share
2 answers

As with any unix command, you can pass yes to the mix command:

 yes | MIX_ENV=test mix do deps.get, compile, test 
+24
source share

You can add this command to the before_install section in .travis.yml

  • mix local.hex --force

After you, of course, have already installed elixir in the previous command. I handled this .travis.yml load from an existing elixir project on github.

 language: erlang env: - ELIXIR="v1.0.0" otp_release: - 17.1 before_install: - mkdir -p vendor/elixir - wget -q https://github.com/elixir-lang/elixir/releases/download/$ELIXIR/Precompiled.zip && unzip -qq Precompiled.zip -d vendor/elixir - export PATH="$PATH:$PWD/vendor/elixir/bin" - mix local.hex --force script: "MIX_ENV=test mix do deps.get, test" 
+28
source share

All Articles