mhausenblas / burry.sh

Cloud Native Infrastructure BackUp & RecoveRY
Apache License 2.0
259 stars 38 forks source link

Vendoring and Makefile #8

Closed nlamirault closed 7 years ago

nlamirault commented 7 years ago

This PR add Makefile, add a goal to make binaries using gox and creates the vendor directory which contains all dependencies using govendor. Some dependencies specify versions :

$ govendor list                
 v  github.com/coreos/etcd/client           v3.2.1  v3.2.1                                                
 v  github.com/coreos/etcd/pkg/pathutil              
 v  github.com/coreos/etcd/pkg/srv                   
 v  github.com/coreos/etcd/pkg/types                 
 v  github.com/coreos/etcd/version                   
 v  github.com/coreos/go-semver/semver               
 v  github.com/hashicorp/consul/api         v0.8.5  v0.8.5                                                
 v  github.com/hashicorp/go-cleanhttp                
 v  github.com/hashicorp/go-rootcerts                
 v  github.com/hashicorp/serf/coordinate             
 v  github.com/minio/minio-go               v2.1.0  v2.1.0                                                
 v  github.com/minio/minio-go/pkg/encrypt   v2.1.0  v2.1.0                                                
 v  github.com/minio/minio-go/pkg/policy    v2.1.0  v2.1.0                                                
 v  github.com/minio/minio-go/pkg/s3signer  v2.1.0  v2.1.0                                                
 v  github.com/minio/minio-go/pkg/s3utils   v2.1.0  v2.1.0                                                
 v  github.com/minio/minio-go/pkg/set       v2.1.0  v2.1.0                                                
 v  github.com/mitchellh/go-homedir                  
 v  github.com/ogier/pflag                           
 v  github.com/pierrre/archivefile/zip               
 v  github.com/samuel/go-zookeeper/zk                
 v  github.com/ugorji/go/codec                       
 v  golang.org/x/net/context                         
 e  github.com/Sirupsen/logrus                       
 e  golang.org/x/sys/unix                            
pl  github.com/mhausenblas/burry.sh                  
  m etcd.go                                          
  m less                                             

$ make build
go build -ldflags="-X main.Version=v0.4.0-12-g29cca00" -o burry-v0.4.0-12-g29cca00
$ ./burry-v0.4.0-12-g29cca00 --version
This is burry in version 0.4.0
$ make gox
$ make binaries               
gox github.com/mhausenblas/burry.sh                  
Number of parallel builds: 3                         

-->      netbsd/arm: github.com/mhausenblas/burry.sh 
-->   windows/amd64: github.com/mhausenblas/burry.sh 
-->   freebsd/amd64: github.com/mhausenblas/burry.sh 
-->   openbsd/amd64: github.com/mhausenblas/burry.sh 
-->     openbsd/386: github.com/mhausenblas/burry.sh 
-->     windows/386: github.com/mhausenblas/burry.sh 
-->       linux/386: github.com/mhausenblas/burry.sh
-->      darwin/386: github.com/mhausenblas/burry.sh
-->    darwin/amd64: github.com/mhausenblas/burry.sh
-->      netbsd/386: github.com/mhausenblas/burry.sh
-->     freebsd/arm: github.com/mhausenblas/burry.sh
-->    netbsd/amd64: github.com/mhausenblas/burry.sh
-->       linux/arm: github.com/mhausenblas/burry.sh
-->     linux/amd64: github.com/mhausenblas/burry.sh
-->     freebsd/386: github.com/mhausenblas/burry.sh
mhausenblas commented 7 years ago

@nlamirault thanks a lot for this PR! It makes tons of sense to do vendoring and also the Makefile is super appreciated. I'd however opt for dep, which is more future-proof since it will be part of the Go tool chain at some point in the future. Any chance you could patch that?

nlamirault commented 7 years ago

I will try using dep

mhausenblas commented 7 years ago

Thanks so much for this @nlamirault! See also my blog post here, should be a good start …

mhausenblas commented 7 years ago

Brilliant, thanks a lot @nlamirault! ATM I don't have a place defined to credit contributors but if you like, add yourself to a section in the README.md to record the fact that you did contribute. WDYT?