-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathMakefile
42 lines (33 loc) · 1.12 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
INFO_COLOR=\033[1;34m
RESET=\033[0m
BOLD=\033[1m
TEST ?= $(shell $(GO) list ./... | grep -v vendor)
REVISION = $(shell git describe --always)
ifeq ("$(shell uname)","Darwin")
GO ?= GO111MODULE=on go
else
GO ?= GO111MODULE=on /usr/local/go/bin/go
endif
default: build
ci: depsdev test integration vet lint
depsdev: ## Installing dependencies for development
$(GO) install golang.org/x/lint/golint@latest
server:
$(GO) run main.go
build: ## Build as linux binary
@echo "$(INFO_COLOR)==> $(RESET)$(BOLD)Building$(RESET)"
$(GO) build -o sshr_bin main.go
test: ## Run test
@echo "$(INFO_COLOR)==> $(RESET)$(BOLD)Testing$(RESET)"
$(GO) test -v $(TEST) -timeout=30s -parallel=4
$(GO) test -race $(TEST)
integration: ## Run integration test after Server wakeup
@echo "$(INFO_COLOR)==> $(RESET)$(BOLD)Integration Testing$(RESET)"
$(GO) test -integration -v $(TEST) -timeout=30s -parallel=4
vet: ## Exec go vet
@echo "$(INFO_COLOR)==> $(RESET)$(BOLD)Vetting$(RESET)"
$(GO) vet $(TEST)
lint: ## Exec golint
@echo "$(INFO_COLOR)==> $(RESET)$(BOLD)Linting$(RESET)"
golint -min_confidence 1.1 -set_exit_status $(TEST)
.PHONY: default test