machine:
  environment:
    IMPORT_PATH: "/home/ubuntu/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME"
    APP_PATH: "$IMPORT_PATH/$CIRCLE_PROJECT_REPONAME"

dependencies:
  override:
    - sudo add-apt-repository ppa:masterminds/glide -y
    - sudo apt-get update
    - sudo apt-get install glide -y
  cache_directories:
    - "vendor"

test:
  pre:
    - mkdir -p "$IMPORT_PATH"
    - ln -sf "$(pwd)" "$APP_PATH"
    - cd "$APP_PATH" && glide install
  override:
    - cd "$APP_PATH" && go test -cover $(glide nv)

machine:
  environment:
    IMPORT_PATH: "/home/ubuntu/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME"
    APP_PATH: "$IMPORT_PATH/$CIRCLE_PROJECT_REPONAME"
    GOX_OS_ARCH: linux/amd64 darwin/amd64 windows/amd64

dependencies:
  override:
    - sudo add-apt-repository ppa:masterminds/glide -y
    - sudo apt-get update
    - sudo apt-get install glide -y
  cache_directories:
    - "vendor"

test:
  pre:
    - mkdir -p "$IMPORT_PATH"
    - ln -sf "$(pwd)" "$APP_PATH"
    - cd "$APP_PATH" && glide install
  override:
    - cd "$APP_PATH" && go test -cover $(glide nv)

deployment:
 release:
  tag: /[0-9]+(\.[0-9]+)*/
  owner: itzg
  commands:
   - go get github.com/mitchellh/gox
   - go get github.com/tcnksm/ghr
   - cd "$APP_PATH" &&
     gox -ldflags "-X main.Version=$CIRCLE_TAG"
     -osarch="$GOX_OS_ARCH"
     -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}"
   - cd "$APP_PATH" &&
     ghr -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME $CIRCLE_TAG dist/
Add deploy to build config
Add deploy to build config
