machine:
  services:
    - docker

checkout:
  post:
    - echo $CIRCLE_BRANCH
    - git clone --depth=1 --branch=$CIRCLE_BRANCH https://github.com/movabletype/movabletype.git
    - cp -r movabletype/* ./

dependencies:
  cache_directories:
    - "~/docker"

  override:
    - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi
    - docker build -t mt .
    - mkdir -p ~/docker; docker save mt > ~/docker/image.tar

test:
  pre:
    - rm t/34-sqlite.t
    - rm t/90-podcoverage.t
    - cp ./t/mysql-test.cfg ./mt-config.cgi
  override:
    - docker run -v $PWD:/var/www/mt -w /var/www/mt mt bash -c "service mysqld start & sleep 10 && service memcached start & sleep 10 && prove plugins/Loupe/t t"

machine:
  services:
    - docker

checkout:
  post:
    - echo $CIRCLE_BRANCH
    - git clone --depth=1 --branch=$CIRCLE_BRANCH https://github.com/movabletype/movabletype.git
    - cp -r movabletype/* ./
    - t/git-mtime t/cpanfile t/ldif/cn=config.ldif t/ldif/domain1_example_jp.ldif t/ldif/domain2_example_jp.ldif t/ldif/example_com.ldif t/ldif/example_jp.ldif

dependencies:
  cache_directories:
    - "~/docker"

  override:
    - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi
    - docker build -t mt .
    - mkdir -p ~/docker; docker save mt > ~/docker/image.tar

test:
  pre:
    - rm t/34-sqlite.t
    - rm t/90-podcoverage.t
    - cp ./t/mysql-test.cfg ./mt-config.cgi
  override:
    - docker run -v $PWD:/var/www/mt -w /var/www/mt mt bash -c "service mysqld start & sleep 10 && service memcached start & sleep 10 && prove plugins/Loupe/t t"

Change timestamp of some files for caching in CircleCI Docker.
Change timestamp of some files for caching in CircleCI Docker.
