machine:
  services:
    - docker

dependencies:
  cache_directories:
    - "~/docker"
  override:
    - docker info
    - if [ -e ~/docker/image.tar ]; then docker load --input ~/docker/image.tar; fi
    - docker build -t cgswong/kibana:v4.0.1 .
    - mkdir -p ~/docker; docker save cgswong/kibana:v4.0.1 > ~/docker/image.tar

test:
  override:
    - docker run -d --publish 5601:5601 --env ES_URL=localhost:9200 cgswong/kibana; sleep 10
#    - curl --retry 10 --retry-delay 5 -Lv http://localhost:5601

deployment:
  hub:
    branch: release
    commands:
      - $DEPLOY

machine:
  services:
    - docker

dependencies:
  cache_directories:
    - "~/docker"
  override:
    - docker info
    - if [ -e ~/docker/image.tar ]; then docker load --input ~/docker/image.tar; fi
    - docker build -t cgswong/kibana:v4.0.1 .
    - mkdir -p ~/docker; docker save cgswong/kibana:v4.0.1 > ~/docker/image.tar

test:
  override:
    - docker run -d --publish 5601:5601 --env ES_URL=localhost:9200 cgswong/kibana; sleep 10
#    - curl --retry 10 --retry-delay 5 -Lv http://localhost:5601

deployment:
  hub:
    branch: v4.0.1
    commands:
      - $DEPLOY

Use v4.0.1 branch in CI.
Use v4.0.1 branch in CI.
