machine:
  pre:
    - bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/1.0.22/binscripts/gvm-installer)

  post:
    - gvm install go1.5.3 -B --name=stable

  environment:
    CHECKOUT: /home/ubuntu/$CIRCLE_PROJECT_REPONAME
    BASE_DIR: src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
    BASE_STABLE: ../../../$HOME/.gvm/pkgsets/stable/global/$BASE_DIR
    GO15VENDOREXPERIMENT: 1

dependencies:
  override:
    - >
      gvm use stable &&
      mkdir -p "$(dirname $BASE_STABLE)" &&
      cp -R "$CHECKOUT" "$BASE_STABLE"

test:
  pre:
    - gvm use stable && make build:
        pwd: $BASE_STABLE
    - gvm use stable && go get github.com/docker/docker-machine-driver-ci-test

  override:
    - gvm use stable && PATH=../../../../bin:$PATH DRIVER=ci-test go test -v github.com/docker/machine/its/...:
        pwd: $BASE_STABLE
        timeout: 600
