-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (42 loc) · 1.07 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
GOFMT_FILES?=$$(find . -name '*.go' | grep -v pb.go | grep -vE "vendor/")
.PHONY: default
default: fmt test build
.PHONY: fmt
fmt:
@echo "--> Formatting source files..."
gofmt -s -w $(GOFMT_FILES)
.PHONY: test
test:
@echo "--> Testing..."
go test -cover ./...
.PHONY: lint
lint:
@echo "--> Running linter..."
@golangci-lint -v run
.PHONY: build
build: fmt test
@echo "--> Building!"
go build -ldflags="-s -w" -o dice-golem
.PHONY: dist
dist:
@echo "--> Building Production binary..."
mkdir -p dist/
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o dist/dice-golem
.PHONY: debug
debug: dev
.PHONY: dev
dev:
@echo "--> Running in dev/debug mode..."
go build -ldflags="-s -w" -o dice-golem
GOLEM_DEBUG=true GOLEM_RECENT=4h ./dice-golem
.PHONY: clean
clean:
@echo "--> Cleaning..."
rm -rf dice-golem dice-golem.exe dist/dice-golem
.PHONY: redis
redis:
@echo "--> Starting Redis container..."
docker run -p 6379:6379 -d redis
.PHONY: docs
docs:
dot -Tsvg -Gfontname="sans-serif" -Nfontname="sans-serif" -Efontname="sans-serif" docs/architecture.dot >docs/architecture.svg