forked from hyperledger-labs/fabric-smart-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
151 lines (124 loc) · 5.59 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
.PHONY: checks
checks: dependencies
@test -z $(shell gofmt -l -s $(shell go list -f '{{.Dir}}' ./...) | tee /dev/stderr) || (echo "Fix formatting issues"; exit 1)
find . -name '*.go' | xargs addlicense -check || (echo "Missing license headers"; exit 1)
@go vet -all $(shell go list -f '{{.Dir}}' ./...)
@ineffassign $(shell go list -f '{{.Dir}}' ./...)
@misspell $(shell go list -f '{{.Dir}}' ./...)
.PHONY: lint
lint:
@golint $(shell go list -f '{{.Dir}}' ./...)
.PHONY: gocyclo
gocyclo:
@gocyclo -over 15 $(shell go list -f '{{.Dir}}' ./...)
.PHONY: ineffassign
ineffassign:
@ineffassign $(shell go list -f '{{.Dir}}' ./...)
.PHONY: misspell
misspell:
@misspell $(shell go list -f '{{.Dir}}' ./...)
.PHONY: unit-tests
unit-tests: docker-images
@go test -cover $(shell go list ./... | grep -v '/integration/')
cd integration/nwo/; go test -cover ./...
.PHONY: unit-tests-race
unit-tests-race: docker-images
@export GORACE=history_size=7; go test -race -cover $(shell go list ./... | grep -v '/integration/')
cd integration/nwo/; go test -cover ./...
.PHONY: docker-images
docker-images: fabric-docker-images weaver-docker-images fpc-docker-images monitoring-docker-images
.PHONY: fabric-docker-images
fabric-docker-images:
docker pull hyperledger/fabric-baseos:2.2
docker image tag hyperledger/fabric-baseos:2.2 hyperledger/fabric-baseos:latest
docker pull hyperledger/fabric-ccenv:2.2
docker image tag hyperledger/fabric-ccenv:2.2 hyperledger/fabric-ccenv:latest
.PHONY: weaver-docker-images
weaver-docker-images:
docker pull ghcr.io/hyperledger-labs/weaver-fabric-driver:1.2.1
docker image tag ghcr.io/hyperledger-labs/weaver-fabric-driver:1.2.1 hyperledger-labs/weaver-fabric-driver:latest
docker pull ghcr.io/hyperledger-labs/weaver-relay-server:1.2.1
docker image tag ghcr.io/hyperledger-labs/weaver-relay-server:1.2.1 hyperledger-labs/weaver-relay-server:latest
.PHONY: fpc-docker-images
fpc-docker-images:
docker pull ghcr.io/mbrandenburger/fpc/ercc:main
docker image tag ghcr.io/mbrandenburger/fpc/ercc:main fpc/ercc:latest
docker pull ghcr.io/mbrandenburger/fpc/fpc-echo:main
docker image tag ghcr.io/mbrandenburger/fpc/fpc-echo:main fpc/fpc-echo:latest
.PHONY: monitoring-docker-images
monitoring-docker-images:
docker pull hyperledger/explorer-db:latest
docker pull hyperledger/explorer:latest
docker pull prom/prometheus:latest
docker pull grafana/grafana:latest
.PHONY: orion-server-images
orion-server-images:
docker pull orionbcdb/orion-server:latest
.PHONY: dependencies
dependencies:
go get -u github.com/onsi/ginkgo/ginkgo
go get -u github.com/gordonklaus/ineffassign
go get -u github.com/google/addlicense
go get -u github.com/client9/misspell/cmd/misspell
.PHONY: integration-tests
integration-tests: docker-images dependencies
cd ./integration/fabric/iou; ginkgo -keepGoing --slowSpecThreshold 60 .
cd ./integration/fabric/atsa/chaincode; ginkgo -keepGoing --slowSpecThreshold 60 .
cd ./integration/fabric/atsa/fsc; ginkgo -keepGoing --slowSpecThreshold 60 .
cd ./integration/fabric/twonets; ginkgo -keepGoing --slowSpecThreshold 60 .
cd ./integration/fsc/pingpong/; ginkgo -keepGoing --slowSpecThreshold 60 .
cd ./integration/fsc/stoprestart; ginkgo -keepGoing --slowSpecThreshold 60 .
.PHONY: integration-tests-iou
integration-tests-iou: docker-images dependencies
cd ./integration/fabric/iou; ginkgo -keepGoing --slowSpecThreshold 60 .
.PHONY: integration-tests-atsacc
integration-tests-atsacc: docker-images dependencies
cd ./integration/fabric/atsa/chaincode; ginkgo -keepGoing --slowSpecThreshold 60 .
.PHONY: integration-tests-atsafsc
integration-tests-atsafsc: docker-images dependencies
cd ./integration/fabric/atsa/fsc; ginkgo -keepGoing --slowSpecThreshold 60 .
.PHONY: integration-tests-twonets
integration-tests-twonets: docker-images dependencies
cd ./integration/fabric/twonets; ginkgo -keepGoing --slowSpecThreshold 60 .
.PHONY: integration-tests-fpc-echo
integration-tests-fpc-echo: docker-images fpc-docker-images dependencies
cd ./integration/fabric/fpc/echo; ginkgo -keepGoing --slowSpecThreshold 60 .
.PHONY: integration-tests-weaver-relay
integration-tests-weaver-relay: docker-images weaver-docker-images dependencies
cd ./integration/fabric/weaver/relay; ginkgo -keepGoing --slowSpecThreshold 60 .
.PHONY: integration-tests-fabric-stoprestart
integration-tests-fabric-stoprestart: docker-images dependencies
cd ./integration/fabric/stoprestart; ginkgo -keepGoing --slowSpecThreshold 60 .
.PHONY: integration-tests-pingpong
integration-tests-pingpong: docker-images dependencies
cd ./integration/fsc/pingpong/; ginkgo -keepGoing --slowSpecThreshold 60 .
.PHONY: integration-tests-stoprestart
integration-tests-stoprestart: docker-images dependencies
cd ./integration/fsc/stoprestart; ginkgo -keepGoing --slowSpecThreshold 60 .
.PHONY: integration-tests-orioncars
integration-tests-orioncars: docker-images orion-server-images dependencies
cd ./integration/orion/cars; ginkgo -keepGoing --slowSpecThreshold 60 .
.PHONY: tidy
tidy:
@go mod tidy
.PHONY: clean
clean:
docker network prune -f
docker container prune -f
rm -rf ./build
rm -rf ./testdata
rm -rf ./integration/fabric/atsa/chaincode/cmd
rm -rf ./integration/fabric/atsa/fsc/cmd
rm -rf ./integration/fabric/iou/cmd/
rm -rf ./integration/fabric/iou/testdata/
rm -rf ./integration/fabric/twonets/cmd
rm -rf ./integration/fabric/weaver/relay/cmd
rm -rf ./integration/fabric/fpc/echo/cmd
rm -rf ./integration/fabric/stoprestart/cmd
rm -rf ./integration/fsc/stoprestart/cmd
rm -rf ./integration/fsc/pingpong/cmd/responder
rm -rf ./integration/orion/cars/cmd
rm -rf ./integration/fscnodes
.PHONY: fsccli
fsccli:
@go install ./cmd/fsccli