machine:
  services:
    - docker

dependencies:
  override:
    # this project uses the gb tool instead of `go build`
    - go get github.com/constabulary/gb/...
    - go get github.com/tcnksm/ghr
    - GOOS=linux GOARCH=amd64 make build
    - GOOS=linux GOARCH=arm make build
    - GOOS=darwin GOARCH=amd64 make build
    - GOOS=windows GOARCH=amd64 make build
    - cp bin/* $CIRCLE_ARTIFACTS
    - docker build -t kindlyops/despite:$CIRCLE_BUILD_NUM .

test:
  override:
    # this project uses the gb tool instead of `go test`
    - gb test

deployment:
  hub:
    branch: master
    commands:
      - docker login -u $DOCKER_USER -p $DOCKER_PASS
      - docker push kindlyops/despite:$CIRCLE_BUILD_NUM

# TODO upload releases to github
# https://medium.com/@jgautheron/publish-your-golang-binaries-in-github-with-circleci-e0b64cb21bf8#.unwbi7kbj

machine:
  pre:
    - curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0
  services:
    - docker

dependencies:
  override:
    # this project uses the gb tool instead of `go build`
    - go get github.com/constabulary/gb/...
    - go get github.com/tcnksm/ghr
    - GOOS=linux GOARCH=amd64 make build
    - GOOS=linux GOARCH=arm make build
    - GOOS=darwin GOARCH=amd64 make build
    - GOOS=windows GOARCH=amd64 make build
    - cp bin/* $CIRCLE_ARTIFACTS
    - docker build -t kindlyops/despite:$CIRCLE_BUILD_NUM .

test:
  override:
    # this project uses the gb tool instead of `go test`
    - gb test

deployment:
  hub:
    branch: master
    commands:
      - docker login -u $DOCKER_USER -p $DOCKER_PASS
      - docker push kindlyops/despite:$CIRCLE_BUILD_NUM

# TODO upload releases to github
# https://medium.com/@jgautheron/publish-your-golang-binaries-in-github-with-circleci-e0b64cb21bf8#.unwbi7kbj

Use docker 1.10 in CircleCI
Use docker 1.10 in CircleCI
