Issue #20: Download a local installation of gx

This way we do not mess with the users stuff

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
This commit is contained in:
Hector Sanjuan 2017-01-24 21:40:43 +01:00
parent 4cc3c1125b
commit 154d4dab74
2 changed files with 34 additions and 9 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
coverage.out
ipfs-cluster-service/ipfs-cluster-service
ipfs-cluster-ctl/ipfs-cluster-ctl
deptools
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o

View File

@ -1,7 +1,16 @@
all: server client
gx_version=v0.10.0
gx-go_version=v1.4.0
gx=gx_$(gx_version)
gx-go=gx-go_$(gx-go_version)
gx_bin=deptools/$(gx)
gx-go_bin=deptools/$(gx-go)
bin_env=$(shell go env GOHOSTOS)-$(shell go env GOHOSTARCH)
all: service ctl
clean: rwundo
$(MAKE) -C ipfs-cluster-service clean
$(MAKE) -C ipfs-cluster-ctl clean
rm -rf deptools
install: deps
$(MAKE) -C ipfs-cluster-service install
$(MAKE) -C ipfs-cluster-ctl install
@ -16,22 +25,37 @@ service: deps
ctl: deps
$(MAKE) -C ipfs-cluster-ctl ipfs-cluster-ctl
gx:
go get github.com/whyrusleeping/gx
go get github.com/whyrusleeping/gx-go
$(gx_bin):
@echo "Downloading gx"
@mkdir -p ./deptools
@wget -nc -q -O $(gx_bin).tgz https://dist.ipfs.io/gx/$(gx_version)/$(gx)_$(bin_env).tar.gz
@tar -zxf $(gx_bin).tgz -C deptools --strip-components=1 gx/gx
@mv deptools/gx $(gx_bin)
@rm $(gx_bin).tgz
$(gx-go_bin):
echo "Downloading gx-go"
mkdir -p ./deptools
wget -nc -q -O $(gx-go_bin).tgz https://dist.ipfs.io/gx-go/$(gx-go_version)/$(gx-go)_$(bin_env).tar.gz
tar -zxf $(gx-go_bin).tgz -C deptools --strip-components=1 gx-go/gx-go
mv deptools/gx-go $(gx-go_bin)
rm $(gx-go_bin).tgz
gx: $(gx_bin) $(gx-go_bin)
deps: gx
go get github.com/gorilla/mux
go get github.com/hashicorp/raft
go get github.com/hashicorp/raft-boltdb
go get github.com/ugorji/go/codec
gx --verbose install --global
gx-go rewrite
$(gx_bin) --verbose install --global
$(gx-go_bin) rewrite
test: deps
go test -tags silent -v -covermode count -coverprofile=coverage.out .
rw:
gx-go rewrite
$(gx-go_bin) rewrite
rwundo:
gx-go rewrite --undo
$(gx-go_bin) rewrite --undo
publish: rwundo
gx publish
$(gx_bin) publish
.PHONY: all gx deps test rw rwundo publish service ctl install clean