version: 2
jobs:
  build:
    machine: true
    working_directory: /root/findingaids
    steps:
      - run:
          name: Install Docker Engine
          command: |
            set -x
            VER="17.03.0-ce"
            curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz
            tar -xz -C /tmp -f /tmp/docker-$VER.tgz
            mv /tmp/docker/* /usr/bin
      - run:
          name: Install Docker Compose
          command: |
            set -x
            curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose 
            chmod +x /usr/local/bin/docker-compose
      - setup_remote_docker
      - checkout
      - run:
          name: Docker Compose Build
          command: docker-compose build
      - run:
          name: Docker Compose Up
          command: docker-compose up -d
      - run:
          name: Create Test DB
          command: |
            docker-compose run web rake db:create
            docker-compose run -e RAILS_ENV=test web rake db:schema:load
      - run:
          name: Run tests
          command: docker-compose run -e RAILS_ENV=test web rake

version: 2
jobs:
  build:
    machine: true
    working_directory: /findingaids
    steps:
      - run:
          name: Install Docker Engine
          command: |
            set -x
            VER="17.03.0-ce"
            curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz
            tar -xz -C /tmp -f /tmp/docker-$VER.tgz
            mv /tmp/docker/* /usr/bin
      - run:
          name: Install Docker Compose
          command: |
            set -x
            curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
            chmod +x /usr/local/bin/docker-compose
      - setup_remote_docker
      - checkout
      - run:
          name: Docker Compose Build
          command: docker-compose build
      - run:
          name: Docker Compose Up
          command: docker-compose up -d
      - run:
          name: Create Test DB
          command: |
            docker-compose run web rake db:create
            docker-compose run -e RAILS_ENV=test web rake db:schema:load
      - run:
          name: Run tests
          command: docker-compose run -e RAILS_ENV=test web rake

Change working dir for circle
Change working dir for circle
