#!/bin/sh
rm -rf traefik
mkdir traefik
GOPATH=`pwd`/traefik
export GOPATH
git clone --depth 1 https://github.com/containous/traefik $GOPATH/src/github.com/containous/traefik
( cd $GOPATH/src/github.com/containous/traefik
  go get -v -d
)
#go get -v -d github.com/containous/traefik/...
#( mkdir -p $GOPATH/src/github.com/containous
#  cd $GOPATH/src/github.com/containous
#  git clone https://github.com/containous/traefik.git )
# shtool subst -e 's;k8s.io/client-go/1.5/kubernetes;k8s.io/client-go/kubernetes;g' \
#     $GOPATH/src/github.com/containous/traefik/provider/k8s/client.go
#(   cd $GOPATH/src/github.com/containous/traefik
#    glide install )
# rm -f traefik/src/github.com/containous/traefik/vendor/github.com/vulcand/vulcand/vulcand
tar cvf - --exclude .git traefik | xz -9 >traefik-`date '+%Y%m%d'`.tar.xz
rm -rf traefik
