forked from alpacahq/marketstore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
74 lines (57 loc) · 2.32 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
.PHONY: plugins
GOFLAGS=""
GOPATH0 := $(firstword $(subst :, ,$(GOPATH)))
UTIL_PATH := github.com/alpacahq/marketstore/utils
build:
GOFLAGS=$(GOFLAGS) go build -ldflags "-s -X $(UTIL_PATH).Tag=$(DOCKER_TAG) -X $(UTIL_PATH).BuildStamp=$(shell date -u +%Y-%m-%d-%H-%M-%S) -X $(UTIL_PATH).GitHash=$(shell git rev-parse HEAD)" .
debug:
$(MAKE) debug -C contrib/ondiskagg
$(MAKE) debug -C contrib/gdaxfeeder
$(MAKE) debug -C contrib/stream
$(MAKE) debug -C contrib/polygon
$(MAKE) debug -C contrib/bitmexfeeder
$(MAKE) debug -C contrib/binancefeeder
$(MAKE) debug -C contrib/iex
$(MAKE) debug -C contrib/xignitefeeder
GOFLAGS=$(GOFLAGS) go install -gcflags="all=-N -l" -ldflags "-X $(UTIL_PATH).Tag=$(DOCKER_TAG) -X $(UTIL_PATH).BuildStamp=$(shell date -u +%Y-%m-%d-%H-%M-%S) -X $(UTIL_PATH).GitHash=$(shell git rev-parse HEAD)" ./...
generate:
make -C sqlparser
GOFLAGS=$(GOFLAGS) go generate $(shell find . -path ./vendor -prune -o -name \*.go -exec grep -q go:generate {} \; -print | while read file; do echo `dirname $$file`; done | xargs)
vendor:
GOFLAGS=$(GOFLAGS) go mod vendor
update:
GOFLAGS=$(GOFLAGS) go mod tidy
plugins:
$(MAKE) -C contrib/ondiskagg
$(MAKE) -C contrib/gdaxfeeder
$(MAKE) -C contrib/stream
$(MAKE) -C contrib/polygon
$(MAKE) -C contrib/bitmexfeeder
$(MAKE) -C contrib/binancefeeder
$(MAKE) -C contrib/iex
$(MAKE) -C contrib/xignitefeeder
fmt:
GOFLAGS=$(GOFLAGS) go fmt ./...
unit-test:
# marketstore/contrib/stream/shelf/shelf_test.go fails if "-race" enabled...
# GOFLAGS=$(GOFLAGS) go test -race -coverprofile=coverage.txt -covermode=atomic ./...
GOFLAGS=$(GOFLAGS) go test -coverprofile=coverage.txt -covermode=atomic ./...
import-csv-test:
@tests/integ/bin/runtests.sh
integration-test:
$(MAKE) -C tests/integ test
test: build
$(MAKE) unit-test
$(MAKE) import-csv-test
$(MAKE) integration-test
image:
docker build . -t marketstore:latest -f $(DOCKER_FILE_PATH)
runimage:
make -C tests/integ run IMAGE_NAME=alpacamarkets/marketstore.test
stopimage:
make -C tests/integ clean IMAGE_NAME=alpacamarkets/marketstore.test
push:
docker build --build-arg tag=$(DOCKER_TAG) -t alpacamarkets/marketstore:$(DOCKER_TAG) -t alpacamarkets/marketstore:latest .
docker login -u $(DOCKER_USER) -p $(DOCKER_PASS)
docker push alpacamarkets/marketstore:$(DOCKER_TAG)
docker push alpacamarkets/marketstore:latest