forked from ortuman/jackal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (33 loc) · 1.11 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
install:
@export GO111MODULE=on && go install -ldflags="-s -w" github.com/ortuman/jackal
install-tools:
@export GO111MODULE=on && go get -u \
golang.org/x/lint/golint \
golang.org/x/tools/cmd/goimports
fmt: install-tools
@echo "Checking go files format..."
@GOIMP=$$(for f in $$(find . -type f -name "*.go" ! -path "./.cache/*" ! -path "./vendor/*" ! -name "bindata.go") ; do \
goimports -l $$f ; \
done) && echo $$GOIMP && test -z "$$GOIMP"
build:
@echo "Building binary..."
@export GO111MODULE=on && go build -ldflags="-s -w"
test:
@echo "Running tests..."
@go test -race $$(go list ./...)
coverage:
@echo "Generating coverage profile..."
@go test -race -coverprofile=coverage.txt -covermode=atomic $$(go list ./...)
vet:
@echo "Searching for buggy code..."
@go vet $$(go list ./...)
lint: install-tools
@echo "Running linter..."
@golint $$(go list ./...)
dockerimage:
@echo "Building binary..."
@env GO111MODULE=on GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w"
@echo "Building docker image..."
@docker build -f dockerfiles/Dockerfile -t ortuman/jackal .
clean:
@go clean