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