-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Brooklyn Zelenka
committed
Aug 29, 2016
1 parent
930d2b4
commit 0ad5813
Showing
3 changed files
with
55 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
machine: | ||
environment: | ||
PATH: "$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH" | ||
|
||
dependencies: | ||
pre: | ||
- script/ci/prepare.sh | ||
- test/prepare_ci.sh | ||
- "MIX_ENV=test mix deps.compile" | ||
- "MIX_ENV=test mix compile" | ||
cache_directories: | ||
- ~/dependencies | ||
- ~/.mix | ||
- _build | ||
- ~/.asdf | ||
- deps | ||
- _build | ||
|
||
test: | ||
override: | ||
- script/ci/tests.sh | ||
- mix test | ||
- mix credo --strict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
erlang_version=18.3 | ||
elixir_version=1.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
# ensure exit codes other than 0 fail the build | ||
set -e | ||
|
||
# asdf | ||
# -- install if not installed before | ||
# -- add plugins if not added before | ||
function asdfPlugin { | ||
asdf plugin-add $1 https://github.com/HashNuke/asdf-$1.git | ||
} | ||
|
||
# Set up Figaro environment variables | ||
# This line can be removed if our PR to FigaroElixir is accepted: | ||
# https://github.com/KamilLelonek/figaro-elixir/pull/1 | ||
touch $HOME/$CIRCLE_PROJECT_REPONAME/config/application.yml | ||
|
||
if ! asdf | grep version; then git clone https://github.com/HashNuke/asdf.git ~/.asdf; fi | ||
if ! asdf plugin-list | grep erlang; then $(asdfPlugin "erlang"); fi | ||
if ! asdf plugin-list | grep elixir; then $(asdfPlugin "elixir"); fi | ||
|
||
# extract vars from elixir_buildpack.config | ||
. elixir_buildpack.config | ||
|
||
# write .tool-versions | ||
if [ ! -f .tool-versions ]; then | ||
echo "erlang $erlang_version" >> .tool-versions | ||
echo "elixir $elixir_version" >> .tool-versions | ||
fi | ||
|
||
# install erlang/elixir | ||
asdf install erlang $erlang_version | ||
asdf install elixir $elixir_version | ||
|
||
# get dependencies | ||
if [ ! -e $HOME/.mix/rebar ]; then | ||
yes | mix local.rebar | ||
fi | ||
|
||
yes | mix deps.get | ||
|
||
# exit successfully | ||
exit 0 |