sudo: required

services:
  - docker

language: node_js
node_js:
  - "6"

env:
  global:
    - ACUITY_SERVER_VERSION=0.1.0
    - SERVER_IMG=entake/acuity-server
    - SERVER_TEST_IMG=$SERVER_IMG:$ACUITY_SERVER_VERSION-test
    - SERVER_RELEASE_IMG=$SERVER_IMG:$ACUITY_SERVER_VERSION

before_install:
  - docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD

install:
  - docker build --pull -t $SERVER_TEST_IMG ./server

script:
  - docker run -e COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN $SERVER_TEST_IMG npm run test-ci

after_success:
  - if [ "$TRAVIS_BRANCH" != "master" ]; then docker push "$SERVER_TEST_IMG"; fi

deploy:
  provider: script
  script: docker tag $SERVER_TEST_IMG $SERVER_RELEASE_IMG \
          && docker tag $SERVER_TEST_IMG $SERVER_IMG:latest \
          && docker push $SERVER_IMG:latest \
          && docker push $SERVER_RELEASE_IMG
  on:
    branch: master

sudo: required

services:
  - docker

language: node_js
node_js:
  - "6"

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

before_install:
  - docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD

install:
  - docker build --pull -t $SERVER_TEST_IMG ./server

script:
  - docker run -e COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN $SERVER_TEST_IMG npm run test-ci

after_success:
  - if [ "$TRAVIS_BRANCH" != "master" ]; then docker push "$SERVER_TEST_IMG"; fi

deploy:
  provider: script
  script: docker tag $SERVER_TEST_IMG $SERVER_RELEASE_IMG \
          && docker tag $SERVER_TEST_IMG $SERVER_IMG:latest \
          && docker push $SERVER_IMG:latest \
          && docker push $SERVER_RELEASE_IMG
  on:
    branch: master

notifications:
  email: false

Rename test image to *.*.*-debug and disable email notifications
Rename test image to *.*.*-debug and disable email notifications
