#!/bin/sh
rm -rf telegraf
mkdir telegraf
export GOPATH=`pwd`/telegraf
#go get -v -d github.com/influxdata/telegraf/...
mkdir -p $GOPATH/src/github.com/influxdata/telegraf
git clone https://github.com/influxdata/telegraf/ $GOPATH/src/github.com/influxdata/telegraf
# ( cd $GOPATH/src/github.com/influxdata/telegraf && gpm get )
( cd $GOPATH/src/github.com/influxdata/telegraf && dep ensure )
tar cf - --exclude .git --exclude .hg --exclude .svn telegraf | xz -9 >telegraf-`date '+%Y%m%d'`.tar.xz
rm -rf telegraf
