machine:
  services:
    - docker
  node:
    version: 6.1.0
  environment:
    DOCKER_MACHINE_VERSION: "v0.10.0"
    ERIS_PULL_APPROVE: true
    MOCHA_FILE: "$CIRCLE_TEST_REPORTS/test-results.xml"

test:
  # Setting up the machine must happen in the 'test' section instead of
  # 'dependencies' in case there's a failure of any kind to guarantee that the
  # machine will be cleaned up.
  override:
    - ./CircleCI/test.sh
  post:
    - if [ "$CIRCLE_BRANCH" = "master" ]; then docker-machine rm -y default; fi

deployment:
  npm:
    branch: master
    commands:
      - bundle-dependencies update
      - printf "$NPM_USERNAME\n$NPM_PASSWORD\n$NPM_EMAIL\n" | npm login
      - npm publish
      - JSDoc/publish.sh
