language: node_js
node_js:
  - 6.4.0
sudo: required
services:
  - docker
before_install:
  - docker run -d --name couchdb couchdb
  - docker build -t lvaldovinos/cv-be .
install:
  - docker run -d --name cv-be --link couchdb:cv-couchdb lvaldovinos/cv-be
script:
  - docker exec -it cv-be npm test
after_script:
  - VERSION=$(docker exec -it cv-be ./index.js --version)
  - docker exec -it cv-be npm install coveralls && cat ./coverage/lcov.info | coveralls
  - docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
  - docker tag lvaldovinos/cv-be lvaldovinos/cv-be:"$VERSION" 
  - docker push lvaldovinos/cv-be
env:
  - CXX=g++-4.8
addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - g++-4.8

language: node_js
node_js:
  - 6.4.0
sudo: required
services:
  - docker
before_install:
  - docker run -d --name couchdb couchdb
  - docker build -t lvaldovinos/cv-be .
install:
  - docker run -d --name cv-be --link couchdb:cv-couchdb lvaldovinos/cv-be
script:
  - docker exec -it cv-be npm test
after_script:
  - VERSION=$(docker exec -it cv-be ./index.js --version)
  - docker exec -it cv-be npm install coveralls && cat ./coverage/lcov.info | coveralls
  - docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
  - docker tag lvaldovinos/cv-be lvaldovinos/cv-be:"$VERSION" 
  - docker push lvaldovinos/cv-be
  - docker push lvaldovinos/cv-be:"$VERSION"
env:
  - CXX=g++-4.8
addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - g++-4.8

Tag latest and specific verstion and push it to hub.docker
Tag latest and specific verstion and push it to hub.docker
