checkout:
  post:
    - rm -rf $HOME/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
    - mkdir -p $HOME/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME
    - cp -r $HOME/$CIRCLE_PROJECT_REPONAME $HOME/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME

machine:
  timezone: Asia/Tokyo

dependencies:
  pre:
    - go get github.com/nitrous-io/goop
  override:
    - goop install

test:
  override:
    - goop go test -v ./... -race
  post:
    - goop go build -v -o _bin/resizer

checkout:
  post:
    - rm -rf $HOME/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
    - mkdir -p $HOME/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME
    - cp -r $HOME/$CIRCLE_PROJECT_REPONAME $HOME/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME
    - go version
    - cat /etc/lsb-release

machine:
  timezone: Asia/Tokyo

dependencies:
  pre:
    - sudo add-apt-repository ppa:masterminds/glide -y && sudo apt-get update -y
    - sudo apt-get install glide -y
  override:
    - glide install

test:
  pre:
    - mysql -u root -e "CREATE DATABASE resizer;"
    - echo $GCLOUD_ACCOUNT_JSON | base64 --decode > $HOME/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/gcloud.json
  override:
    - go test github.com/syoya/resizer/fetcher
    - go test github.com/syoya/resizer/log
    - go test github.com/syoya/resizer/option
    - go test github.com/syoya/resizer/processor
    - go test github.com/syoya/resizer/server
    - go test github.com/syoya/resizer/storage
    - go test github.com/syoya/resizer/uploader
  post:
    - go build -v

deployment:
  release:
    branch: release
  commands:
    - go get -d github.com/laher/goxc
    - goxc -wlc default publish-github -apikey=$GITHUB_TOKEN
    - goxc bump
    - goxc -bc="linux,windows,darwin"
    - git config --global user.email "release@circleci.com"
    - git config --global user.name "CircleCI"
    - git commit ".goxc.json" -m "Bump version [ci skip]"
    - git push https://${GITHUB_TOKEN}@github.com/go-microservices/resizer.git release}]

Fix Circle CI configuration for release
Fix Circle CI configuration for release


Former-commit-id: dd1ff2a6f8d218f122ace9f4f0b9674485e88fa5