-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
76 lines (64 loc) · 2.02 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
LENSVERSION=`git describe --tags`
EDITION=cpu
GOFLAGS=
DIST=$(shell uname)
ifeq ($(DIST), Linux)
GOFLAGS=-tags gcc7
endif
lens:
@make cli
.PHONY: deps
deps:
@echo "=================== generating dependencies ==================="
# Install tensorflow
bash setup/scripts/tensorflow_install.sh
# Install tesseract
bash setup/scripts/tesseract_install.sh
# Update standard dependencies
GO111MODULE=on go mod vendor
# install gofitz with flags
GO111MODULE=on go get $(GOFLAGS) github.com/gen2brain/go-fitz
@echo "=================== done ==================="
# Build lens cli
.PHONY: cli
cli:
@echo "==================== building Lens CLI ======================"
rm -f temporal-lens
go build $(GOFLAGS) \
-ldflags "-X main.Version=$(LENSVERSION) -X main.Edition=$(EDITION)" \
./cmd/temporal-lens
@echo "=================== done ==================="
# Set up test environment
.PHONY: testenv
WAIT=3
testenv:
@echo "=================== preparing test env ==================="
docker-compose -f test/docker-compose.yml up -d
sleep $(WAIT)
@echo "=================== done ==================="
.PHONY: testenv-integration
testenv-integration: testenv
@echo Connecting testenv IPFS node to RTrade IPFS node for test assets
ipfs --api=/ip4/127.0.0.1/tcp/5001 swarm connect /ip4/172.218.49.115/tcp/5002/ipfs/Qmf964tiE9JaxqntDsSBGasD4aaofPQtfYZyMSJJkRrVTQ
# Run simple checks
.PHONY: check
check:
go vet $(GOFLAGS) ./...
go test $(GOFLAGS) -run xxxx ./...
# Generate code
.PHONY: gen
gen:
GO111MODULE=on go generate ./...
# Build docker release
.PHONY: docker
docker:
@echo "=================== building docker image ==================="
@echo EDITION: $(EDITION)
@docker build \
--build-arg LENSVERSION=$(LENSVERSION)-$(EDITION) \
--build-arg TENSORFLOW_DIST=$(EDITION) \
-t rtradetech/lens:$(LENSVERSION)-$(EDITION) .
@echo "=================== done ==================="
.PHONY: v2
v2: cli
./temporal-lens --dev --cfg test/config.json v2