#!/bin/sh
rm -rf consul
mkdir consul
GOPATH=`pwd`/consul
export GOPATH
#go get -v -d github.com/hashicorp/consul/...
#go get -v -d github.com/hashicorp/consul
git clone --depth 1 https://github.com/hashicorp/consul $GOPATH/src/github.com/hashicorp/consul
( cd $GOPATH/src/github.com/hashicorp/consul
  make -f GNUmakefile tools
)
tar cvf - --exclude .git consul/src | xz -9 >consul-`date '+%Y%m%d'`.tar.xz
rm -rf consul
