-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (46 loc) · 1.22 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
include .env
BINARY := buildconfig
VERSION := $(shell git describe --always --dirty --tags 2>/dev/null || echo "undefined")
ECHO := echo
.NOTPARALLEL:
.PHONY: all
all: test build
.PHONY: build
build: clean $(BINARY)
.PHONY: clean
clean:
rm -f $(BINARY)
.PHONY: distclean
distclean: clean
rm -f .env
.PHONY: fmt
fmt:
$(GO) fmt ./pkg/... ./cmd/...
.PHONY: vet
vet:
$(GO) vet -tags dev -composites=false ./pkg/... ./cmd/...
lint:
@ $(ECHO) "\033[36mLinting code\033[0m"
$(LINTER) run --disable-all \
--exclude-use-default=false \
--enable=govet \
--enable=ineffassign \
--enable=deadcode \
--enable=golint \
--enable=goconst \
--enable=gofmt \
--enable=goimports \
--skip-dirs=pkg/client/ \
--deadline=120s \
--tests ./...
@ $(ECHO)
.PHONY: check
check: fmt lint vet test
.PHONY: test
test:
@ $(ECHO) "\033[36mRunning test suite in Ginkgo\033[0m"
$(GINKGO) -v -p -race -randomizeAllSpecs ./pkg/... ./cmd/...
@ $(ECHO)
# Build sis
$(BINARY): fmt vet
GO111MODULE=on CGO_ENABLED=0 $(GO) build -o $(BINARY) -ldflags="-X main.VERSION=${VERSION}" ./cmd/...