machine:
  environment:
    GODIST: "go1.8.linux-amd64.tar.gz"
    PATH: "/usr/local/go/bin:/usr/local/go_workspace/bin:~/.go_workspace/bin:${PATH}"
    GOPATH: "${HOME}/.go_workspace:/usr/local/go_workspace:${HOME}/.go_project"
    PROJECT: "${HOME}/.go_project/src/github.com/jamesnetherton/homehub-cli"
  post:
    - mkdir -p download
    - mkdir -p ${HOME}/.go_project/src/github.com/jamesnetherton/
    - cd ${HOME}/.go_project/src/github.com/jamesnetherton/ && ln -s ${HOME}/homehub-cli homehub-cli
    - test -e download/$GODIST || curl -o download/$GODIST https://storage.googleapis.com/golang/$GODIST
    - sudo rm -rf /usr/local/go
    - sudo tar -C /usr/local -xzf download/$GODIST

dependencies:
  cache_directories:
    - ~/download
  override:
    - cd ${PROJECT} && make build

test:
  override:
    - cd ${PROJECT} && make test

deployment:
  release:
    branch: release
    commands:
      - cd ${PROJECT} && make release

machine:
  environment:
    GODIST: "go1.8.linux-amd64.tar.gz"
    PATH: "/usr/local/go/bin:/usr/local/go_workspace/bin:~/.go_workspace/bin:${PATH}"
    GOPATH: "${HOME}/.go_workspace:/usr/local/go_workspace:${HOME}/.go_project"
    PROJECT: "${HOME}/.go_project/src/github.com/jamesnetherton/homehub-cli"
  post:
    - mkdir -p download
    - mkdir -p ${HOME}/.go_project/src/github.com/jamesnetherton/
    - cd ${HOME}/.go_project/src/github.com/jamesnetherton/ && ln -s ${HOME}/homehub-cli homehub-cli
    - test -e download/$GODIST || curl -o download/$GODIST https://storage.googleapis.com/golang/$GODIST
    - sudo rm -rf /usr/local/go
    - sudo tar -C /usr/local -xzf download/$GODIST

dependencies:
  cache_directories:
    - ~/download

test:
  override:
    - cd ${PROJECT} && make test

deployment:
  release:
    branch: release
    commands:
      - cd ${PROJECT} && make release

Remove explicit build before test
Remove explicit build before test
