-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
51 lines (38 loc) · 1.18 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
TEST ?= ./...
REVISION = $$(git describe --always)
DATE = $$(LC_ALL=c date -u +%a,\ %d\ %b\ %Y\ %H:%M:%S\ GMT)
LOGLEVEL ?= info
ifeq ("$(shell uname)","Darwin")
NCPU ?= $(shell sysctl hw.ncpu | cut -f2 -d' ')
else
NCPU ?= $(shell cat /proc/cpuinfo | grep processor | wc -l)
endif
TEST_OPTIONS=-timeout 30s -parallel $(NCPU)
default: build
build:
go build ./cmd/dewy
server: build
./dewy server -r linyows/dewy-testapp -a dewy-testapp_darwin_amd64.tar.gz \
-p 8000 -l $(LOGLEVEL) -- $(HOME)/.go/src/github.com/linyows/dewy/current/dewy-testapp
assets: build
./dewy assets -r linyows/dewy-testapp -a dewy-testapp_darwin_amd64.tar.gz -l $(LOGLEVEL)
deps:
go get golang.org/x/lint/golint
go get github.com/goreleaser/goreleaser
test:
go test $(TEST) $(TESTARGS) $(TEST_OPTIONS)
go test -race $(TEST) $(TESTARGS) -coverprofile=coverage.txt -covermode=atomic
integration:
go test -integration $(TEST) $(TESTARGS) $(TEST_OPTIONS)
lint:
golangci-lint run ./...
ci: deps test lint
git diff go.mod
xbuild:
goreleaser --rm-dist --snapshot --skip-validate
dist:
@test -z $(GITHUB_TOKEN) || goreleaser --rm-dist --skip-validate
clean:
git checkout go.*
git clean -f
.PHONY: default dist test deps