forked from saintpete/logrole
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
115 lines (88 loc) · 3.42 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
# would be great to make the bash location portable but not sure how
SHELL = /bin/bash
BENCHSTAT := $(GOPATH)/bin/benchstat
BUMP_VERSION := $(GOPATH)/bin/bump_version
DIFFER := $(GOPATH)/bin/differ
GODOCDOC := $(GOPATH)/bin/godocdoc
GO_BINDATA := $(GOPATH)/bin/go-bindata
DEP := $(GOPATH)/bin/dep
JUSTRUN := $(GOPATH)/bin/justrun
WRITE_MAILMAP := $(GOPATH)/bin/write_mailmap
STATICCHECK := $(GOPATH)/bin/staticcheck
WATCH_TARGETS = static/css/style.css \
templates/base.html \
templates/phone-numbers/list.html templates/phone-numbers/instance.html \
templates/conferences/instance.html templates/conferences/list.html \
templates/alerts/list.html templates/alerts/instance.html \
templates/errors.html templates/login.html \
templates/snippets/phonenumber.html \
services/error_reporter.go services/services.go \
server/calls.go server/alerts.go server/phonenumbers.go \
server/serve.go server/render.go views/client.go views/numbers.go \
Makefile config.yml
ASSET_TARGETS = templates/base.html templates/index.html \
templates/messages/list.html templates/messages/instance.html \
templates/calls/list.html templates/calls/instance.html \
templates/calls/recordings.html \
templates/conferences/list.html templates/conferences/instance.html \
templates/alerts/list.html templates/alerts/instance.html \
templates/phone-numbers/list.html \
templates/snippets/phonenumber.html \
templates/errors.html templates/login.html \
static/css/style.css static/css/bootstrap.min.css
test: vet
@# this target should always be listed first so "make" runs the tests.
go list ./... | grep -v vendor | xargs go test -short
race-test: vet
go list ./... | grep -v vendor | xargs go test -race
serve:
go run commands/logrole_server/main.go
vet:
@# We can't vet the vendor directory, it fails.
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck@latest --checks='["all", "-ST1005", "-S1002"]' ./...
deploy:
git push heroku master
compile-css: static/css/bootstrap.min.css static/css/style.css
cat static/css/bootstrap.min.css static/css/style.css > static/css/all.css
$(GO_BINDATA):
go get -u github.com/kevinburke/go-bindata/...
assets: $(ASSET_TARGETS) compile-css | $(GO_BINDATA)
$(GO_BINDATA) -o=assets/bindata.go --nometadata --pkg=assets templates/... static/...
$(JUSTRUN):
go get -u github.com/jmhodges/justrun
watch: | $(JUSTRUN)
$(JUSTRUN) -v --delay=100ms -c 'make assets serve' $(WATCH_TARGETS)
$(DEP):
go get -u github.com/golang/dep/cmd/dep
deps: | $(DEP)
$(DEP) ensure
$(DEP) prune
$(BUMP_VERSION):
go get github.com/Shyp/bump_version
$(DIFFER):
go get github.com/kevinburke/differ
$(GODOCDOC):
go get github.com/kevinburke/godocdoc
release: race-test | $(BUMP_VERSION) $(DIFFER)
$(DIFFER) $(MAKE) authors
$(BUMP_VERSION) minor http.go
docs: | $(GODOCDOC)
$(GODOCDOC)
bench:
tmp=$$(mktemp); go list ./... | grep -v vendor | xargs go test -benchtime=2s -bench=. -run='^$$' > "$$tmp" 2>&1 && go run golang.org/x/perf/cmd/benchstat@latest "$$tmp"
loc:
cloc --exclude-dir=.git,tmp,vendor --not-match-f='bootstrap.min.css|all.css|bindata.go' .
# For Travis. Run the tests with unvendored dependencies, just check the latest
# version of everything out to the GOPATH.
unvendored: $(DEP)
rm -rf vendor
$(MAKE) race-test
go mod vendor
ci: race-test bench unvendored
$(WRITE_MAILMAP):
go get github.com/kevinburke/write_mailmap
AUTHORS.txt: | $(WRITE_MAILMAP)
$(WRITE_MAILMAP) > AUTHORS.txt
authors: AUTHORS.txt
write_mailmap > AUTHORS.txt