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