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