defaults: &defaults
  working_directory: ~/ludwig
  docker:
    - image: circleci/node:6.14-stretch

version: 2
jobs:
  install:
    <<: *defaults
    steps:
      - checkout
      - run:
          name: Install dependencies
          command: npm install
      - persist_to_workspace:
          root: .
          paths:
            - node_modules
  test:
    <<: *defaults
    steps:
      - checkout
      - attach_workspace:
          at: ~/ludwig
      - run:
          name: Run tests
          command: npm test
  deploy:
    machine:
      enabled: true
    steps:
      - run:
          name: Deploy on production
          command: |
            ssh cloud@ludwig.incubateur.net

workflows:
  version: 2
  build_and_test:
    jobs:
      - install
      - test:
          requires:
            - install
      - deploy:
          requires:
            - test
          filters:
            branches:
              only: master

defaults: &defaults
  working_directory: ~/ludwig
  docker:
    - image: circleci/node:6.14-stretch
    - image: mongo:3.2.18

version: 2
jobs:
  install:
    <<: *defaults
    steps:
      - checkout
      - run:
          name: Install dependencies
          command: npm install
      - persist_to_workspace:
          root: .
          paths:
            - node_modules
  test:
    <<: *defaults
    steps:
      - checkout
      - attach_workspace:
          at: ~/ludwig
      - run:
          name: Run tests
          command: npm test
  deploy:
    machine:
      enabled: true
    steps:
      - run:
          name: Deploy on production
          command: |
            ssh cloud@ludwig.incubateur.net

workflows:
  version: 2
  build_and_test:
    jobs:
      - install
      - test:
          requires:
            - install
      - deploy:
          requires:
            - test
          filters:
            branches:
              only: master

Add mongo server in CI
Add mongo server in CI
