Skip to content

Instantly share code, notes, and snippets.

@johnmosesman
Last active July 10, 2018 11:59
Show Gist options
  • Save johnmosesman/5a471a2de124eb1c6e2c9223faf28663 to your computer and use it in GitHub Desktop.
Save johnmosesman/5a471a2de124eb1c6e2c9223faf28663 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Totally c&p from various places all accross Internet
# [JohnMosesman]: Even MORE c&p from http://codegists.com/snippet/shell/codeship-elixirsh_paulgoetze_shell & http://www.codegists.com/snippet/shell/elixirsh_lessless_shell
#
# Erlang
ERLANG_VERSION=${ERLANG_VERSION:-19.0}
ERLANG_CACHED_DOWNLOAD="${HOME}/cache/OTP-${ERLANG_VERSION}.tar.gz"
ERLANG_DIR=${ERLANG_DIR:="$HOME/erlang"}
# Elixir
ELIXIR_VERSION=${ELIXIR_VERSION:-1.3.4}
ELIXIR_CACHED_DOWNLOAD="${HOME}/cache/elixir-v${ELIXIR_VERSION}.zip"
ELIXIR_DIR=${ELIXIR_DIR:="$HOME/elixir"}
# Erlan download
echo Installing Erlang version ${ERLANG_VERSION}
wget --continue --output-document "${ERLANG_CACHED_DOWNLOAD}" "https://s3.amazonaws.com/heroku-buildpack-elixir/erlang/cedar-14/OTP-${ERLANG_VERSION}.tar.gz"
mkdir "${ERLANG_DIR}"
tar -xaf "${ERLANG_CACHED_DOWNLOAD}" --strip-components=1 --directory "${ERLANG_DIR}"
${ERLANG_DIR}/Install -minimal ${ERLANG_DIR}
export PATH="${ERLANG_DIR}/bin:$PATH"
# Elixir download
echo Installing Erlang version ${ELIXIR_VERSION}
wget --continue --output-document "${ELIXIR_CACHED_DOWNLOAD}" "https://s3.amazonaws.com/s3.hex.pm/builds/elixir/v${ELIXIR_VERSION}.zip"
mkdir ${ELIXIR_DIR}
cd ${ELIXIR_DIR}
unzip -q ${ELIXIR_CACHED_DOWNLOAD}
export PATH="${ELIXIR_DIR}/bin:$PATH"
cd -
mix local.hex --force
mix local.rebar
mix hex.info
export MIX_ENV=test
mix deps.get
mix deps.compile
mix ecto.create
# Add `mix test` to the Test Commands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment