forked from findy-network/findy-agent-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
127 lines (92 loc) · 3.31 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
AGENT_BRANCH=$(shell scripts/branch.sh ../findy-agent/)
API_BRANCH=$(shell scripts/branch.sh ../findy-agent-api/)
AUTH_BRANCH=$(shell scripts/branch.sh ../findy-agent-auth/)
GRPC_BRANCH=$(shell scripts/branch.sh ../findy-common-go/)
WRAP_BRANCH=$(shell scripts/branch.sh ../findy-wrapper-go/)
drop_wrap:
go mod edit -dropreplace github.com/findy-network/findy-wrapper-go
drop_comm:
go mod edit -dropreplace github.com/findy-network/findy-common-go
drop_auth:
go mod edit -dropreplace github.com/findy-network/findy-agent-auth
drop_api:
go mod edit -dropreplace github.com/findy-network/findy-agent-api
drop_agent:
go mod edit -dropreplace github.com/findy-network/findy-agent
drop_all: drop_api drop_comm drop_wrap drop_wrap drop_auth
repl_wrap:
go mod edit -replace github.com/findy-network/findy-wrapper-go=../findy-wrapper-go
repl_comm:
go mod edit -replace github.com/findy-network/findy-common-go=../findy-common-go
repl_api:
go mod edit -replace github.com/findy-network/findy-agent-api=../findy-agent-api
repl_auth:
go mod edit -replace github.com/findy-network/findy-agent-auth=../findy-agent-auth
repl_agent:
go mod edit -replace github.com/findy-network/findy-agent=../findy-agent
repl_all: repl_api repl_comm repl_wrap repl_agent repl_auth
modules: modules_api modules_auth modules_wrap modules_comm modules_agent
modules_api: drop_api
@echo Syncing modules: findy-agent-api/$(API_BRANCH)
go get github.com/findy-network/findy-agent-api@$(API_BRANCH)
modules_auth: drop_auth
@echo Syncing modules: findy-agent-api/@$(AUTH_BRANCH)
go get github.com/findy-network/findy-agent-auth@$(AUTH_BRANCH)
modules_wrap: drop_wrap
@echo Syncing modules: findy-agent-api/$(WRAP_BRANCH)
go get github.com/findy-network/findy-wrapper-go@$(WRAP_BRANCH)
modules_comm: drop_comm
@echo Syncing modules: findy-agent-api/$(GRPC_BRANCH)
go get github.com/findy-network/findy-common-go@$(GRPC_BRANCH)
modules_agent: drop_agent
@echo Syncing modules: findy-agent-api/$(AGENT_BRANCH)
go get github.com/findy-network/findy-agent@$(AGENT_BRANCH)
deps:
go get -t ./...
scan:
@scripts/scan.sh $(ARGS)
build:
go build ./...
cli:
$(eval VERSION = $(shell cat ./VERSION) $(shell date))
@echo "Installing version $(VERSION)"
go build \
-ldflags "-X 'github.com/findy-network/findy-agent-cli/utils.Version=$(VERSION)'" \
-o $(GOPATH)/bin/cli
misspell:
@go get github.com/client9/misspell
@find . -name '*.md' -o -name '*.go' -o -name '*.puml' | xargs \
misspell -error -locale GB
vet:
go vet ./...
shadow:
@echo Running govet
go vet -vettool=$(GOPATH)/bin/shadow ./...
@echo Govet success
check_fmt:
$(eval GOFILES = $(shell find . -name '*.go'))
@gofmt -l $(GOFILES)
lint:
@golangci-lint run
lint_e:
@$(GOPATH)/bin/golint ./... | grep -v export | cat
test:
go test -v -p 1 -failfast ./...
test_cov_out:
go test \
-coverpkg=github.com/findy-network/findy-agent-cli/... \
-coverprofile=coverage.txt \
-covermode=atomic \
./...
test_cov: test_cov_out
go tool cover -html=coverage.txt
check: check_fmt vet shadow
install:
$(eval VERSION = $(shell cat ./VERSION) $(shell date))
@echo "Installing version $(VERSION)"
go install \
-ldflags "-X 'github.com/findy-network/findy-agent-cli/utils.Version=$(VERSION)'" \
./...
# https://goreleaser.com/install/
test_release:
goreleaser --snapshot --skip-publish --rm-dist