machine:
  node:
    version: "6.1.0"
  python:
    version: "3.5.1"
  environment:
    DATABASE_URL: postgres://ubuntu:@127.0.0.1:5432/circle_test
    DJANGO_SETTINGS_MODULE: saleor.settings
    SECRET_KEY: irrelevant
  services:
    - docker

dependencies:
  pre:
    - yarn
    - pip install -r requirements.txt
  override:
    - yarn run build-assets --production
    - ./manage.py collectstatic --no-input
    - sed -i.bak "s#'dev'#'$(git describe --tags)'#" saleor/__init__.py
  post:
    - docker build --rm=false -t mirumee/saleor:latest .
test:
  override:
    - docker run --net=host -e DATABASE_URL -e DJANGO_SETTINGS_MODULE -e SECRET_KEY mirumee/saleor:latest pytest

deployment:
  release:
    tag: /v.*/
    commands:
      - docker login -e $DOCKERCLOUD_EMAIL -u $DOCKERCLOUD_USER -p $DOCKERCLOUD_PASS
      - docker tag mirumee/saleor:latest mirumee/saleor:$CIRCLE_TAG
      - docker push mirumee/saleor:$CIRCLE_TAG
      - docker push mirumee/saleor:latest
      - curl -X POST https://circleci.com/api/v1.1/project/github/mirumee/saleor-demo?circle-token=$CIRCLE_API_TOKEN

machine:
  node:
    version: "6.1.0"
  python:
    version: "3.5.1"
  environment:
    DATABASE_URL: postgres://ubuntu:@127.0.0.1:5432/circle_test
    DJANGO_SETTINGS_MODULE: saleor.settings
    SECRET_KEY: irrelevant
  services:
    - docker

dependencies:
  pre:
    - yarn
    - yarn add --force node-sass # force our way around https://github.com/yarnpkg/yarn/issues/1981
    - pip install -r requirements.txt
  override:
    - yarn run build-assets --production
    - ./manage.py collectstatic --no-input
    - sed -i.bak "s#'dev'#'$(git describe --tags)'#" saleor/__init__.py
  post:
    - docker build --rm=false -t mirumee/saleor:latest .
test:
  override:
    - docker run --net=host -e DATABASE_URL -e DJANGO_SETTINGS_MODULE -e SECRET_KEY mirumee/saleor:latest pytest

deployment:
  release:
    tag: /v.*/
    commands:
      - docker login -e $DOCKERCLOUD_EMAIL -u $DOCKERCLOUD_USER -p $DOCKERCLOUD_PASS
      - docker tag mirumee/saleor:latest mirumee/saleor:$CIRCLE_TAG
      - docker push mirumee/saleor:$CIRCLE_TAG
      - docker push mirumee/saleor:latest
      - curl -X POST https://circleci.com/api/v1.1/project/github/mirumee/saleor-demo?circle-token=$CIRCLE_API_TOKEN

Fix failing node-sass on CI
Fix failing node-sass on CI
