stages:
  - test

services:
  - mongo:latest

variables:
  MONGO_URI: 'mongodb://mongo/app_name'
  NODE_ENV: 'test'

before_script:
  - npm install --global gulp gulp-cli babel babel-cli babel-core babel-register mocha gulp-mocha gulp-eslint
  - npm install

run_tests:
  stage: test
  script:
    - ping -W1 -c1 mongo
    - mv config.json.example config.json
    - sed -i -e 's/"debug" : false/"debug" : true/g' config.json
    - gulp build
    - cd build/
    - mocha
  tags:
    - node
  cache:
    paths:
      - node_modules/
