Skip to content

Commit

Permalink
Fix hex version warnings on travis
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmj committed Mar 14, 2016
1 parent 71908e7 commit b252a7d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ before_install:
- wget http://s3.hex.pm/builds/elixir/${ELIXIR}.zip
- unzip -d elixir ${ELIXIR}.zip
- export PATH=$(pwd)/elixir/bin:${PATH}

- mkdir -p ${HEXWEB_MIX_HOME}
- PATH=$(pwd)/${HEXWEB_ELIXIR_PATH}/bin:$(pwd)/${HEXWEB_OTP_PATH}/bin:${PATH} MIX_HOME=$(pwd)/${HEXWEB_MIX_HOME} mix local.hex --force
- mix local.hex --force
before_script:
- git clone https://github.com/hexpm/hex_web.git
- cd hex_web; PATH=$(pwd)/../${HEXWEB_ELIXIR_PATH}/bin:$(pwd)/../${HEXWEB_OTP_PATH}/bin:${PATH} ../${HEXWEB_ELIXIR_PATH}/bin/mix deps.get; cd ..
- cd hex_web; PATH=$(pwd)/../${HEXWEB_ELIXIR_PATH}/bin:$(pwd)/../${HEXWEB_OTP_PATH}/bin:${PATH} MIX_ENV=hex ../${HEXWEB_ELIXIR_PATH}/bin/mix compile; cd ..
- cd hex_web; PATH=$(pwd)/../${HEXWEB_ELIXIR_PATH}/bin:$(pwd)/../${HEXWEB_OTP_PATH}/bin:${PATH} MIX_HOME=$(pwd)/../${HEXWEB_MIX_HOME} MIX_ENV=hex ../${HEXWEB_ELIXIR_PATH}/bin/mix deps.get; cd ..
- cd hex_web; PATH=$(pwd)/../${HEXWEB_ELIXIR_PATH}/bin:$(pwd)/../${HEXWEB_OTP_PATH}/bin:${PATH} MIX_HOME=$(pwd)/../${HEXWEB_MIX_HOME} MIX_ENV=hex ../${HEXWEB_ELIXIR_PATH}/bin/mix compile; cd ..
- mix deps.get
- MIX_ENV=test mix deps.compile
script:
Expand All @@ -32,6 +35,7 @@ env:
- HEXWEB_PATH=hex_web
- HEXWEB_ELIXIR_PATH=hexweb_elixir
- HEXWEB_OTP_PATH=hexweb_otp
- HEXWEB_MIX_HOME=hexweb_mix
matrix:
- ELIXIR=v1.0.5
- ELIXIR=v1.1.1
Expand Down
15 changes: 14 additions & 1 deletion test/support/hex_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ defmodule HexTest.HexWeb do

def start do
path = String.to_char_list(path())
hexweb_mix_home = String.to_char_list(hexweb_mix_home())
key = Path.join(__DIR__, "../fixtures/test_priv.pem")
|> File.read!
|> String.to_char_list

env = [
{'MIX_ENV', 'hex'},
{'MIX_HOME', hexweb_mix_home},
{'PATH', path},
{'HEX_SIGNING_KEY', key}
]
Expand Down Expand Up @@ -101,11 +103,22 @@ defmodule HexTest.HexWeb do
end
end

defp hexweb_mix_home do
(System.get_env("HEXWEB_MIX_HOME") || Mix.Utils.mix_home)
|> Path.expand
end

defp cmd(command, args) do
env = [
{"MIX_ENV", "hex"},
{"PATH", path()},
{"MIX_HOME", hexweb_mix_home()}
]

opts = [
stderr_to_stdout: true,
into: IO.stream(:stdio, :line),
env: [{"MIX_ENV", "hex"}, {"PATH", path()}],
env: env,
cd: hexweb_dir()]

0 = System.cmd(command, args, opts) |> elem(1)
Expand Down

0 comments on commit b252a7d

Please sign in to comment.