machine:
  node:
    version: 8.9.0
  services:
    - docker

dependencies:
  pre:
    - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
    - sudo apt-get update
    - sudo apt-get install -y libstdc++-4.9-dev
  override:
    - if [ ! -f $HOME/.meteor/meteor ]; then curl https://install.meteor.com | sh; fi
    - sudo ln -s $HOME/.meteor/meteor /usr/bin/meteor
  cache_directories:
    - ../.meteor

test:
  override:
    - cd tests && bash run_tests.sh

deployment:
  docker:
    branch: /^node-[0-9.]+$/
    commands:
      - docker images
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS

machine:
  node:
    version: 8.9.0
  services:
    - docker
  environment:
    NODE_VERSION: 4.8.6

dependencies:
  pre:
    - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
    - sudo apt-get update
    - sudo apt-get install -y libstdc++-4.9-dev
  override:
    - if [ ! -f $HOME/.meteor/meteor ]; then curl https://install.meteor.com | sh; fi
    - sudo ln -s $HOME/.meteor/meteor /usr/bin/meteor
  cache_directories:
    - ../.meteor

test:
  override:
    - cd tests && bash run_tests.sh

deployment:
  docker:
    branch: /^node-[0-9.]+$/
    commands:
      - docker images
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker push "abernix/meteord:node-${NODE_VERSION}-base"
      - docker push "abernix/meteord:node-${NODE_VERSION}-onbuild"
      - docker push "abernix/meteord:node-${NODE_VERSION}-devbuild"
      - docker push "abernix/meteord:node-${NODE_VERSION}-binbuild"

Use NODE_VERSION env variable for deploy.
Use NODE_VERSION env variable for deploy.
