machine:
  ruby:
    version: 2.0.0
  timezone: Asia/Tokyo
  post:
    # Use newer version of docker
    # https://discuss.circleci.com/t/support-docker-versions-newer-than-v1-9-1/7789/50
    - curl -fsSLO https://get.docker.com/builds/Linux/x86_64/docker-1.13.1.tgz && sudo tar --strip-components=1 -xvzf docker-1.13.1.tgz -C /usr/local/bin
    - sudo container=yes docker daemon: { background: true }

dependencies:
  cache_directories:
    - "~/docker"
    - "~/vendor/bundle"
  override:
    - bundle install --path ~/vendor/bundle --deployment:
        timeout: 1800
    - if [[ -e ~/docker/ubuntu-14.04.tar ]]; then docker load -i ~/docker/ubuntu-14.04.tar; fi
    - bundle exec thor docker:build
    - mkdir -p ~/docker; docker save mackerelio/cookbook-mackerel-agent-ubuntu-14.04 > ~/docker/ubuntu-14.04.tar

test:
  override:
    - DOCKER_HOST="unix:///var/run/docker.sock" bundle exec thor docker:spec

machine:
  services:
    - docker
  ruby:
    version: 2.0.0
  timezone: Asia/Tokyo

dependencies:
  cache_directories:
    - "~/docker"
    - "~/vendor/bundle"
  override:
    - bundle install --path ~/vendor/bundle --deployment:
        timeout: 1800
    - if [[ -e ~/docker/ubuntu-14.04.tar ]]; then docker load -i ~/docker/ubuntu-14.04.tar; fi
    - bundle exec thor docker:build
    - mkdir -p ~/docker; docker save mackerelio/cookbook-mackerel-agent-ubuntu-14.04 > ~/docker/ubuntu-14.04.tar

test:
  override:
    - DOCKER_HOST="unix:///var/run/docker.sock" bundle exec thor docker:spec

Revert "try to use newer docker engine"
Revert "try to use newer docker engine"

This reverts commit 5a9acc208aa15357d35a1ebdec154691476b1cfd.
