machine:
  post:
    - rm -rf ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
    - mkdir -p ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}
    - cp -r ${HOME}/${CIRCLE_PROJECT_REPONAME} ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
    - git config --global user.email "billings@erisindustries.com"
    - git config --global user.name "Billings the Bot"

dependencies:
  pre:
    - sudo curl -L -o /usr/bin/docker 'http://s3-external-1.amazonaws.com/circle-downloads/docker-1.6.0-circleci'; chmod 0755 /usr/bin/docker; true
    - sudo service docker start
    - "sudo apt-get update && sudo apt-get install -y libgmp3-dev"

  override:
    - "cd ./cmd/erisdb && go build"
    - "mv ~/eris-db/cmd/erisdb/erisdb ~/bin"
    - chmod +x ~/bin/erisdb

test:
  override:
    - go test -v ./...

deployment:
  master:
    branch: master
    commands:
      - docker build -t eris/erisdb:0.10 -f DOCKER/Dockerfile .
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker push eris/erisdb:0.10
