forked from basho/riak-go-client
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
71 lines (57 loc) · 2.19 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
.PHONY: all install-deps
.PHONY: unit-test integration-test security-test test fmt help
.PHONY: fmt lint protogen release
PROJDIR = $(realpath $(CURDIR))
PROTOC_VERSION := $(shell protoc --version)
export RIAK_HOST = localhost
export RIAK_PORT = 8087
all: install-deps lint test
install-deps:
cd $(PROJDIR) && go get -t github.com/basho/riak-go-client/...
lint: install-deps
cd $(PROJDIR) && go tool vet -shadow=true -shadowstrict=true $(PROJDIR)
cd $(PROJDIR) && go vet github.com/basho/riak-go-client/...
unit-test: lint
cd $(PROJDIR) && go test -v
integration-test: lint
cd $(PROJDIR) && go test -v -tags='integration timeseries'
timeseries-test: lint
cd $(PROJDIR) && go test -v -tags=timeseries
security-test: lint
cd $(PROJDIR) && go test -v -tags=security
test: integration-test
fmt:
cd $(PROJDIR) && gofmt -s -w .
protogen:
ifeq ($(PROTOC_VERSION),)
$(error The protoc command is required to parse proto files)
endif
ifneq ($(PROTOC_VERSION),libprotoc 2.6.1)
$(error protoc must be version 2.6.1)
endif
$(PROJDIR)/build/protogen $(PROJDIR)
release:
ifeq ($(VERSION),)
$(error VERSION must be set to deploy this code)
endif
ifeq ($(RELEASE_GPG_KEYNAME),)
$(error RELEASE_GPG_KEYNAME must be set to deploy this code)
endif
@$(PROJDIR)/tools/build/publish $(VERSION) master validate
@git tag --sign -a "$(VERSION)" -m "riak-go-client $(VERSION)" --local-user "$(RELEASE_GPG_KEYNAME)"
@git push --tags
@$(PROJDIR)/tools/build/publish $(VERSION) master 'Riak Go Client' 'riak-go-client'
help:
@echo ''
@echo ' Targets:'
@echo '----------------------------------------------------------'
@echo ' all - Run everything '
@echo ' fmt - Format code '
@echo ' lint - Run "go vet" '
@echo ' test - Run unit & integration tests '
@echo ' unit-test - Run unit tests '
@echo ' integration-test - Run integration tests '
@echo ' timeseries-test - Run timeseries tests '
@echo ' security-test - Run security tests '
@echo '----------------------------------------------------------'
@echo ''