machine:
  environment:
    GOPATH: $HOME/.local/lib/go
    PATH: $PATH:$HOME/.local/bin:${GOPATH//://bin:}/bin
checkout:
  post:
    - mkdir -p $GOPATH
dependencies:
  pre:
    - pip install --user bzr
  cache_directories:
    - "../.local"
test:
  override:
    - go test
    - go build -o "$(basename $PWD)"
deployment:
  master:
    branch: [master, feature/circleci-integration]
    commands:
      - go get github.com/surma/s3put
      - "[ ! -z \"$S3KEY\" ] && [ ! -z \"$S3SECRET\" ] && [ ! -z \"$S3BUCKET\" ] || (echo \"missing s3put environment variables\"; exit 1)"
      - s3put -k "$S3KEY" -s "$S3SECRET" -r eu-west-1 -b "$S3BUCKET" put -p "$(basename $PWD)/$CIRCLE_BRANCH/linux_amd64/$CIRCLE_BUILD_NUM/" "$(basename $PWD)"
      - s3put -k "$S3KEY" -s "$S3SECRET" -r eu-west-1 -b "$S3BUCKET" put -p "$(basename $PWD)/$CIRCLE_BRANCH/linux_amd64/current/" "$(basename $PWD)"

machine:
  environment:
    GOPATH: $HOME/.local/lib/go
    PATH: $PATH:$HOME/.local/bin:${GOPATH//://bin:}/bin
checkout:
  post:
    - mkdir -p $GOPATH
dependencies:
  pre:
    - pip install --user bzr
  cache_directories:
    - "../.local"
test:
  override:
    - go test
    - go build -o "$(basename $PWD)"
deployment:
  master:
    branch: [master, develop]
    commands:
      - go get github.com/surma/s3put
      - "[ ! -z \"$S3KEY\" ] && [ ! -z \"$S3SECRET\" ] && [ ! -z \"$S3BUCKET\" ] || (echo \"missing s3put environment variables\"; exit 1)"
      - s3put -k "$S3KEY" -s "$S3SECRET" -r eu-west-1 -b "$S3BUCKET" put -p "$(basename $PWD)/$CIRCLE_BRANCH/linux_amd64/$CIRCLE_BUILD_NUM/" "$(basename $PWD)"
      - s3put -k "$S3KEY" -s "$S3SECRET" -r eu-west-1 -b "$S3BUCKET" put -p "$(basename $PWD)/$CIRCLE_BRANCH/linux_amd64/current/" "$(basename $PWD)"

Deploy develop instead of old feature branch
Deploy develop instead of old feature branch
