Skip to content

Commit

Permalink
Enable go.mod for ipfs-cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
hsanjuan committed Mar 8, 2019
1 parent 3511012 commit db3ff39
Show file tree
Hide file tree
Showing 6 changed files with 635 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Expand Up @@ -12,30 +12,31 @@ sudo: required
cache:
directories:
- $GOPATH/src/gx
- $GOPATH/pkg/mod
- $HOME/.cache/go-build

install: true

env:
- GO111MODULE=on

jobs:
include:
- stage: "Testing stage"
name: "Tests (all modules) + Coverage"
script:
- make deps
- go test -v -coverprofile=coverage.txt -covermode=atomic ./...
after_success:
- bash <(curl -s https://codecov.io/bash)
- name: "Main Tests with basic monitor"
script:
- make deps
- go test -v . -monitor basic
- name: "Main Tests with stateless tracker"
script:
- make deps
- go test -v . -tracker stateless
- name: "Golint and go vet"
script:
- go get -u golang.org/x/lint/golint
- make deps
- make check
- make service
- make ctl
Expand All @@ -47,7 +48,6 @@ jobs:
script:
- sudo apt-get update
- sudo apt-get install -y jq curl
- make deps
- make install
- docker pull ipfs/go-ipfs
- make test_sharness && make clean_sharness
1 change: 1 addition & 0 deletions Dockerfile
Expand Up @@ -5,6 +5,7 @@ MAINTAINER Hector Sanjuan <hector@protocol.ai>

ENV GOPATH /go
ENV SRC_PATH $GOPATH/src/github.com/ipfs/ipfs-cluster
ENV GO111MODULE on

COPY . $SRC_PATH
WORKDIR $SRC_PATH
Expand Down
1 change: 1 addition & 0 deletions Dockerfile-test
Expand Up @@ -5,6 +5,7 @@ MAINTAINER Hector Sanjuan <hector@protocol.ai>

ENV GOPATH /go
ENV SRC_PATH $GOPATH/src/github.com/ipfs/ipfs-cluster
ENV GO111MODULE on

COPY . $SRC_PATH
WORKDIR $SRC_PATH
Expand Down
30 changes: 19 additions & 11 deletions Makefile
@@ -1,5 +1,6 @@
deptools=deptools
sharness = sharness/lib/sharness
GXENABLED=no # Set to yes for Gx builds.
gx=$(deptools)/gx
gx-go=$(deptools)/gx-go

Expand All @@ -15,52 +16,59 @@ clean: rwundo clean_sharness
@rm -rf ./test/testingData
@rm -rf ./compose

install: deps
install: gx-deps
$(MAKE) -C cmd/ipfs-cluster-service install
$(MAKE) -C cmd/ipfs-cluster-ctl install

docker_install: docker_deps
docker_install: docker_gx-deps
$(MAKE) -C cmd/ipfs-cluster-service install
$(MAKE) -C cmd/ipfs-cluster-ctl install

build: deps
build: gx-deps
go build -ldflags "-X ipfscluster.Commit=$(shell git rev-parse HEAD)"
$(MAKE) -C cmd/ipfs-cluster-service build
$(MAKE) -C cmd/ipfs-cluster-ctl build

service: deps
service: gx-deps
$(MAKE) -C cmd/ipfs-cluster-service ipfs-cluster-service
ctl: deps
ctl: gx-deps
$(MAKE) -C cmd/ipfs-cluster-ctl ipfs-cluster-ctl

gx-clean: clean
$(MAKE) -C $(deptools) gx-clean

gx:
ifeq ($(GXENABLED),yes)
$(MAKE) -C $(deptools) gx
endif

deps: gx

gx-deps: gx
ifeq ($(GXENABLED),yes)
$(gx) install --global
$(gx-go) rewrite
endif

# Run this target before building the docker image
# and then gx won't attempt to pull all deps
# from the network each time
docker_deps: gx
docker_gx-deps: gx
ifeq ($(GXENABLED),yes)
$(gx) install --local
$(gx-go) rewrite
endif

check:
go vet ./...
golint -set_exit_status -min_confidence 0.3 ./...

test: deps
test: gx-deps
go test -v ./...

test_sharness: $(sharness)
@sh sharness/run-sharness-tests.sh

test_problem: deps
test_problem: gx-deps
go test -timeout 20m -loglevel "DEBUG" -v -run $(problematic_test)

$(sharness):
Expand Down Expand Up @@ -104,6 +112,6 @@ docker-compose:
docker exec cluster1 ipfs-cluster-ctl peers ls | grep -o "Sees 1 other peers" | uniq -c | grep 2
docker-compose down

prcheck: deps check service ctl test
prcheck: gx-deps check service ctl test

.PHONY: all gx deps test test_sharness clean_sharness rw rwundo publish service ctl install clean gx-clean docker
.PHONY: all gx gx-deps test test_sharness clean_sharness rw rwundo publish service ctl install clean gx-clean docker
70 changes: 70 additions & 0 deletions go.mod
@@ -0,0 +1,70 @@
module github.com/ipfs/ipfs-cluster

require (
github.com/blang/semver v3.5.1+incompatible
github.com/boltdb/bolt v1.3.1 // indirect
github.com/dustin/go-humanize v1.0.0
github.com/gogo/protobuf v1.2.1
github.com/golang/protobuf v1.3.0
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect
github.com/gorilla/mux v1.7.0
github.com/hashicorp/go-uuid v1.0.1 // indirect
github.com/hashicorp/raft v1.0.0
github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea
github.com/hsanjuan/go-libp2p-gostream v0.0.30
github.com/hsanjuan/go-libp2p-http v0.0.1
github.com/huin/goupnp v1.0.0 // indirect
github.com/ipfs/go-block-format v0.0.2
github.com/ipfs/go-cid v0.0.1
github.com/ipfs/go-datastore v0.0.1
github.com/ipfs/go-fs-lock v0.0.1
github.com/ipfs/go-ipfs-api v0.0.1
github.com/ipfs/go-ipfs-chunker v0.0.1
github.com/ipfs/go-ipfs-ds-help v0.0.1
github.com/ipfs/go-ipfs-files v0.0.1
github.com/ipfs/go-ipfs-posinfo v0.0.1
github.com/ipfs/go-ipfs-util v0.0.1
github.com/ipfs/go-ipld-cbor v0.0.1
github.com/ipfs/go-ipld-format v0.0.1
github.com/ipfs/go-log v0.0.1
github.com/ipfs/go-merkledag v0.0.1
github.com/ipfs/go-mfs v0.0.1
github.com/ipfs/go-path v0.0.1
github.com/ipfs/go-unixfs v0.0.1
github.com/jackpal/gateway v1.0.5 // indirect
github.com/kelseyhightower/envconfig v1.3.0
github.com/lanzafame/go-libp2p-ocgorpc v0.0.1
github.com/libp2p/go-libp2p v0.0.2
github.com/libp2p/go-libp2p-consensus v0.0.1
github.com/libp2p/go-libp2p-crypto v0.0.1
github.com/libp2p/go-libp2p-gorpc v0.0.2
github.com/libp2p/go-libp2p-host v0.0.1
github.com/libp2p/go-libp2p-interface-pnet v0.0.1
github.com/libp2p/go-libp2p-kad-dht v0.0.4
github.com/libp2p/go-libp2p-peer v0.0.1
github.com/libp2p/go-libp2p-peerstore v0.0.1
github.com/libp2p/go-libp2p-pnet v0.0.1
github.com/libp2p/go-libp2p-protocol v0.0.1
github.com/libp2p/go-libp2p-pubsub v0.0.1
github.com/libp2p/go-libp2p-raft v0.0.2
github.com/libp2p/go-ws-transport v0.0.1
github.com/mattn/go-isatty v0.0.6 // indirect
github.com/multiformats/go-multiaddr v0.0.2
github.com/multiformats/go-multiaddr-dns v0.0.2
github.com/multiformats/go-multiaddr-net v0.0.1
github.com/multiformats/go-multicodec v0.1.6
github.com/multiformats/go-multihash v0.0.1
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect
github.com/prometheus/procfs v0.0.0-20190306233201-d0f344d83b0c // indirect
github.com/rs/cors v1.6.0
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
github.com/ugorji/go v0.0.0-20171015030454-f26fc641ec9d
github.com/urfave/cli v1.20.0
github.com/zenground0/go-dot v0.0.0-20180912213407-94a425d4984e
go.opencensus.io v0.19.1
golang.org/x/sys v0.0.0-20190308023053-584f3b12f43e // indirect
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 // indirect
google.golang.org/api v0.1.0 // indirect
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 // indirect
)

0 comments on commit db3ff39

Please sign in to comment.