-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
60 lines (45 loc) · 1.29 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
##
## NOTE: This makefile is just helpful stuff for the developer.
## You don't need it to build this project, just use the regular go tooling.
##
GO?=go
GO_CODE=$(shell find . -name '*.go')
GO_TEMPLATES=$(shell find . -name '*.go.html')
SOURCES=go.mod Makefile $(GO_CODE) $(GO_TEMPLATES)
.PHONY: all loc test lint gotest build run updatedeps clean releaselocal
all: build
loc:
wc -l `git ls-files '*.go'` | sort
wc -l `git ls-files '*.go.html'` | sort
test: lint gotest badge.svg
lint:
golangci-lint run --timeout 5m0s ./...
gotest:
$(GO) test -race -cover ./...
badge.svg: $(SOURCES)
AMOUNT=$(shell $(GO) test -cover ./internal/rssole | cut -f 4 | cut -f 2 -d ' ' | cut -f 1 -d '.'); \
sed "s/100%/$$AMOUNT%/g" [email protected] >$@
build: rssole
run:
$(GO) run -race ./cmd/rssole
rssole: $(SOURCES)
$(GO) build ./cmd/rssole
updatedeps:
$(GO) get -u ./...
coveragereport:
go test -v -coverprofile cover.out ./...
go tool cover -html cover.out -o cover.html
open cover.html
releaselocal:
goreleaser release --snapshot --clean
clean:
$(GO) clean
$(GO) clean -cache -modcache -testcache
rm -Rf dist
rm -Rf .test_dummy
rm -f rssole
deploycolin:
-ssh colin.local "killall rssole"
GOOS=linux make build
scp rssole colin.local:.
ssh colin.local "nohup ./rssole 2>rssole.out 1>rssole.out &"