machine:
  services:
    - docker

dependencies:
  cache_directories:
    - "~/docker"

  pre:
    - pip install awscli
    - wget https://dl.bintray.com/mitchellh/terraform/terraform_0.6.4_linux_amd64.zip
    - unzip terraform_0.6.4_linux_amd64.zip

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

test:
  override:
    - docker run -d listenrightmeow/dbot:latest
    - aws s3 cp s3://dla-dbot/.terraform/terraform.tfvars ./
    - ./terraform plan -out=terraform.plan ./terraform/build

deployment:
  production:
    branch: master
    commands:
      - ./terraform apply terraform.plan
machine:
  services:
    - docker

dependencies:
  cache_directories:
    - "~/docker"

  pre:
    - cd .terraform && wget https://dl.bintray.com/mitchellh/terraform/terraform_0.6.4_linux_amd64.zip && unzip terraform_0.6.4_linux_amd64.zip

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

test:
  override:
    - docker run -d listenrightmeow/dbot:latest
    - aws s3 cp s3://dla-dbot/.terraform/terraform.tfvars ./
    - cd .terraform/ && ./terraform plan -out=terraform.plan build

deployment:
  production:
    branch: master
    commands:
      - cd .terraform/ && ./terraform apply terraform.plan
Move TF executables to .terraform directory and execute
Move TF executables to .terraform directory and execute
