version: 0.2

phases:
  install:
    commands:
      - echo "${DOCKERHUB_PASSWORD}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin
      - nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2&
      - timeout 15 sh -c "until docker info; do echo .; sleep 1; done"
  pre_build:
    commands:
      - docker build -t mysql-es .
  build:
    commands:
      - docker-compose up -d
      - docker ps
      - docker image inspect mysql-es
      - docker run --network="host" mysql-es cargo test
