Skip to content

Instantly share code, notes, and snippets.

@tompesman
Created March 14, 2017 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tompesman/63baab8ce0a4eef7bc9379466116e687 to your computer and use it in GitHub Desktop.
Save tompesman/63baab8ce0a4eef7bc9379466116e687 to your computer and use it in GitHub Desktop.
CicleCI config for Elixir with Phoenix Framework and deployment to Heroku
machine:
node:
version: 6.2.0
environment:
PATH: "$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH"
MIX_ENV: "test"
services:
- postgresql
database:
override:
- createdb appname_test
dependencies:
cache_directories:
- ~/.asdf
- _build
- deps
pre:
- if ! asdf | grep version; then git clone https://github.com/HashNuke/asdf.git ~/.asdf; fi
- if ! asdf plugin-list | grep erlang; then asdf plugin-add erlang https://github.com/HashNuke/asdf-erlang.git; fi
- if ! asdf plugin-list | grep elixir; then asdf plugin-add elixir https://github.com/HashNuke/asdf-elixir.git; fi
- erlang_version=$(awk '/erlang/ { print $2 }' .tool-versions) && asdf install erlang ${erlang_version}
- elixir_version=$(awk '/elixir/ { print $2 }' .tool-versions) && asdf install elixir ${elixir_version}
- yes | mix deps.get
- yes | mix local.rebar
- mix compile
test:
override:
- mix test
- mkdir -p $CIRCLE_TEST_REPORTS/exunit
- cp _build/test/lib/appname/test-junit-report.xml $CIRCLE_TEST_REPORTS/exunit
deployment:
staging:
branch: develop
heroku:
appname: appname-staging
production:
branch: master
heroku:
appname: appname-production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment