summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rwxr-xr-x[-rw-r--r--]Makefile67
1 files changed, 44 insertions, 23 deletions
diff --git a/Makefile b/Makefile
index 383b7699..9ad158ba 100644..100755
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,44 @@
-test:
- go clean -testcache
- go test -v -race -cover . -tags=debug
- go test -v -race -cover ./plugins/rpc -tags=debug
- go test -v -race -cover ./plugins/rpc/tests -tags=debug
- go test -v -race -cover ./plugins/config/tests -tags=debug
- go test -v -race -cover ./plugins/server/tests -tags=debug
- go test -v -race -cover ./plugins/logger/tests -tags=debug
- go test -v -race -cover ./plugins/metrics/tests -tags=debug
- go test -v -race -cover ./plugins/informer/tests -tags=debug
- go test -v -race -cover ./plugins/resetter/tests -tags=debug
- go test -v -race -cover ./plugins/http/attributes -tags=debug
- go test -v -race -cover ./plugins/http/tests -tags=debug
- go test -v -race -cover ./plugins/gzip/tests -tags=debug
- go test -v -race -cover ./plugins/static/tests -tags=debug
- go test -v -race -cover ./plugins/static -tags=debug
- go test -v -race -cover ./plugins/headers/tests -tags=debug
- go test -v -race -cover ./plugins/checker/tests -tags=debug
-
-test_headers:
- go test -v -race -cover ./plugins/headers/tests -tags=debug
-test_checker:
- go test -v -race -cover ./plugins/checker/tests -tags=debug \ No newline at end of file
+#!/usr/bin/make
+# Makefile readme (ru): <http://linux.yaroslavl.ru/docs/prog/gnu_make_3-79_russian_manual.html>
+# Makefile readme (en): <https://www.gnu.org/software/make/manual/html_node/index.html#SEC_Contents>
+
+SHELL = /bin/sh
+
+.DEFAULT_GOAL := build
+
+# This will output the help for each task. thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
+help: ## Show this help
+ @printf "\033[33m%s:\033[0m\n" 'Available commands'
+ @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf " \033[32m%-14s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
+
+build: ## Build RR binary file for local os/arch
+ CGO_ENABLED=0 go build -trimpath -ldflags "-s" -o ./rr ./cmd/rr/main.go
+
+clean: ## Make some clean
+ rm ./rr
+
+install: build ## Build and install RR locally
+ cp rr /usr/local/bin/rr
+
+uninstall: ## Uninstall locally installed RR
+ rm -f /usr/local/bin/rr
+
+test: ## Run application tests
+ test -d ./vendor_php || composer update --prefer-dist --ansi
+ go test -v -race -cover
+ go test -v -race -cover ./util
+ go test -v -race -cover ./service
+ go test -v -race -cover ./service/env
+ go test -v -race -cover ./service/rpc
+ go test -v -race -cover ./service/http
+ go test -v -race -cover ./service/static
+ go test -v -race -cover ./service/limit
+ go test -v -race -cover ./service/headers
+ go test -v -race -cover ./service/metrics
+ go test -v -race -cover ./service/health
+ go test -v -race -cover ./service/gzip
+ go test -v -race -cover ./service/reload
+
+lint: ## Run application linters
+ go fmt ./...
+ golint ./...