This repository has been archived by the owner on Nov 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
44 lines (33 loc) · 1.61 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
help: ## Display this help message.
@echo "Please use \`make <target>\` where <target> is one of:"
@grep '^[a-zA-Z]' $(MAKEFILE_LIST) | \
awk -F ':.*?## ' 'NF==2 {printf " %-26s%s\n", $$1, $$2}'
cert: ## Generate TLS certificate for nginx for local testing with mkcert.
cd nginx && mkcert pmm-api pmm-api.test pmm-api.localhost 127.0.0.1
init: ## Install prototool and fill vendor/.
# https://github.com/uber/prototool#installation
curl -L https://github.com/uber/prototool/releases/download/v1.3.0/prototool-$(shell uname -s)-$(shell uname -m) -o ./prototool
chmod +x ./prototool
dep ensure -v
gen: clean ## Generate files.
go install -v ./vendor/github.com/golang/protobuf/protoc-gen-go \
./vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \
./vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger \
./vendor/github.com/go-swagger/go-swagger/cmd/swagger
./prototool all
# no public API for pmm-agent
rm -f agent/*.swagger.json
swagger mixin inventory/inventory.json inventory/*.swagger.json --output=inventory.swagger.json
swagger validate inventory.swagger.json
rm -f inventory/*.swagger.json
mkdir http
swagger generate client --spec=inventory.swagger.json --target=http
go install -v ./...
clean: ## Remove generated files.
find . -name '*.pb.go' -not -path './vendor/*' -delete
find . -name '*.pb.gw.go' -not -path './vendor/*' -delete
find . -name '*.swagger.json' -not -path './vendor/*' -delete
rm -fr http
serve: ## Serve API documentation with nginx.
# https://pmm-api.test:8443/
nginx -p . -c nginx/nginx.conf