#!/bin/sh -x
rm -rf cockroach
GOPATH="`pwd`/cockroach"
export GOPATH
mkdir -p $GOPATH
( cd $GOPATH
  #go get -v -d github.com/cockroachdb/cockroach
  mkdir -p src/github.com/cockroachdb
  ( cd src/github.com/cockroachdb
    git clone https://github.com/cockroachdb/cockroach
  )
  ( cd src/github.com/cockroachdb/cockroach
    git co -f release-1.1
    git submodule update --init --recursive
  )
)
tar cvf - --exclude .git cockroach | xz -9 >cockroach-`date '+%Y%m%d'`.tar.xz
rm -rf cockroach
