-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
70 lines (58 loc) · 1.59 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
61
62
63
64
65
66
67
68
# Default unit executable extension
EXE=
ifeq ($(OS), Windows_NT)
EXE=.exe
endif
# Go parameters
GOCMD:=go
GOBUILD:=$(GOCMD) build
GOINSTALL:=$(GOCMD) install
GOCLEAN:=$(GOCMD) clean
GOTEST:=$(GOCMD) test
GOGET:=$(GOCMD) get
GOVET:=$(GOCMD) vet
GOLINT:=golint
BINARY_UNIX:=resiproxy
BINARY_NAME:=$(BINARY_UNIX)$(EXE)
LDFLAGS:=
ifeq (, $(shell which rice))
$(error "No rice in your PATH, run: go get github.com/GeertJohan/go.rice/rice ")
endif
.PHONY: all build install coverage lint test clean run deps build-linux preso docs docker-build docker-push build test
## Building
all: test build
deps:
go mod download
build: $(BINARY_NAME)
$(BINARY_NAME): deps
CGO_ENABLED=0 $(GOBUILD) -o $(BINARY_NAME) -ldflags "-s -w"
install: deps
CGO_ENABLED=0 $(GOINSTALL) $(TAGS) -ldflags "-s -w"
## Dev testing
docker-build:
docker build -t marqub/resiproxy:dev .
docker-run: docker-build
docker run -ti --rm marqub/resiproxy:dev
docker-push: docker-build
docker push marqub/resiproxy:dev
helm: docker-push
helm upgrade --install resiproxy --namespace resiproxy --recreate-pods --wait --tiller-namespace=resiproxy chart
delete:
helm delete --purge --tiller-namespace=resiproxy resiproxy | true
## Documentation
docs:
./gendocs.sh
## Testing
coverage: deps
$(GOTEST) $(TAGS) -coverprofile .testCoverage.txt ./... && go tool cover -func=.testCoverage.txt
lint:
$(GOLINT) -set_exit_status ./...
vet:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GOVET) $(TAGS) ./...
test: deps
$(GOTEST) -short -race $(TAGS) ./...
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
rm -f $(BINARY_UNIX)
rm -rf rice-box.go