sudo: required

services:
  - docker

language: node_js
node_js:
  - "6"

env:
  global:
    - ACUITY_SERVER_VERSION=0.1.0
    - SERVER_IMG=entake/acuity-server
    - SERVER_DEBUG_IMG=$SERVER_IMG:$ACUITY_SERVER_VERSION-debug
    - SERVER_RELEASE_IMG=$SERVER_IMG:$ACUITY_SERVER_VERSION

cache:
  directories:
    - $TRAVIS_BUILD_DIR/server/node_modules
    - $(npm config get prefix)/bin/yarn

before_install:
  - npm list -g yarn --depth=0 || npm install -g yarn

install:
  - cd $TRAVIS_BUILD_DIR/server && yarn

script:
  - cd $TRAVIS_BUILD_DIR/server && npm run test-ci

after_success:
  - cd $TRAVIS_BUILD_DIR/server && bash <(curl -s https://codecov.io/bash) # Report coverage to Codecov
  - docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD # Login to Docker Hub
  - docker build --pull -t $SERVER_DEBUG_IMG $TRAVIS_BUILD_DIR/server # Build server debug image
  - if [ "$TRAVIS_BRANCH" != "master" ]; then docker push "$SERVER_DEBUG_IMG"; fi # Push server debug image to registry except on master

deploy:
  provider: script
  script: $TRAVIS_BUILD_DIR/util/deploy.sh
  on:
    branch: master

notifications:
  email: false

sudo: required

services:
  - docker

language: node_js
node_js:
  - "6.9.1"

env:
  global:
    - ACUITY_SERVER_VERSION=0.1.0
    - SERVER_IMG=entake/acuity-server
    - SERVER_DEBUG_IMG=$SERVER_IMG:$ACUITY_SERVER_VERSION-debug
    - SERVER_RELEASE_IMG=$SERVER_IMG:$ACUITY_SERVER_VERSION

cache:
  directories:
    - $TRAVIS_BUILD_DIR/server/node_modules
    - $(npm config get prefix)/bin/yarn

before_install:
  - npm list -g yarn --depth=0 || npm install -g yarn

install:
  - cd $TRAVIS_BUILD_DIR/server && yarn

script:
  - cd $TRAVIS_BUILD_DIR/server && npm run test-ci

after_success:
  - cd $TRAVIS_BUILD_DIR/server && bash <(curl -s https://codecov.io/bash) # Report coverage to Codecov
  - docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD # Login to Docker Hub
  - docker build --pull -t $SERVER_DEBUG_IMG $TRAVIS_BUILD_DIR/server # Build server debug image
  - if [ "$TRAVIS_BRANCH" != "master" ]; then docker push "$SERVER_DEBUG_IMG"; fi # Push server debug image to registry except on master

deploy:
  provider: script
  script: $TRAVIS_BUILD_DIR/util/deploy.sh
  on:
    branch: master

notifications:
  email: false

Use new Node LTS version in Travis config
Use new Node LTS version in Travis config
