[英]Elixir mix auto acknowledge
I want to run tests of my Phoenix app on Travis-CI.我想在 Travis-CI 上运行我的 Phoenix 应用程序的测试。
Log excerpt:日志摘录:
$ 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 fetching and installing dependencies, it asks if it should install hex
.在获取和安装依赖项时,它会询问是否应该安装
hex
。 I was wondering if I can pass a --yes
option to mix so that it doesn't ask but just installs?我想知道我是否可以通过
--yes
选项来混合,这样它就不会询问而只是安装?
You can add this command to your before_install section in .travis.yml您可以将此命令添加到 .travis.yml 中的 before_install 部分
After of course, you've already installed elixir in a previous command.当然,您已经在之前的命令中安装了 elixir。 I cargo culted this .travis.yml from an existing elixir project on github.
我从 github 上现有的 elixir 项目中提取了这个 .travis.yml。
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"
As with any unix command, you could pipe yes
into the mix command:与任何 unix 命令一样,您可以将
yes
给 mix 命令:
yes | MIX_ENV=test mix do deps.get, compile, test
But there are some warnings about this solution in the comments below.但是在下面的评论中有一些关于这个解决方案的警告。 I recommend using the top voted solution!
我建议使用票数最高的解决方案!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.