generated from octoposprime/temp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
48 lines (43 loc) · 1.43 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
GOCMD=go
GOTEST=$(GOCMD) test
GOBUILD=$(GOCMD) build
BINARY_NAME=main
VERSION?=0.0.0#Docker image release version
DOCKER_REGISTRY?=ghcr.io#Docker registry
DOCKER_REPOSITORY?=octoposprime#Docker repository owner
DOCKER_CONTAINER?=op-be-****#Docker image name
EXPORT_RESULT?=false# for CI please set EXPORT_RESULT to true
TEST?=false#is the container test?
LOCAL_PORT=18080#Grpc port for local
CONTAINER_PORT=18080#Grpc port in container
NETWORK=op#Docker network name
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
CYAN := $(shell tput -Txterm setaf 6)
RESET := $(shell tput -Txterm sgr0)
.PHONY: all test build coverage lint
all: help
## Generate:
proto-generate: ## Protobuf Generate
protoc -I=pkg/proto/model \
--go_out=../../../ \
--go-grpc_out=../../../ \
pkg/proto/model/error.proto \
pkg/proto/model/logging.proto \
pkg/proto/model/authentication.proto \
pkg/proto/model/authorization.proto \
pkg/proto/model/user.proto \
pkg/proto/model/book.proto \
--experimental_allow_proto3_optional
## Help:
help: ## Show this help.
@echo ''
@echo 'Usage:'
@echo ' ${YELLOW}make${RESET} ${GREEN}<target>${RESET}'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} { \
if (/^[a-zA-Z_-]+:.*?##.*$$/) {printf " ${YELLOW}%-20s${GREEN}%s${RESET}\n", $$1, $$2} \
else if (/^## .*$$/) {printf " ${CYAN}%s${RESET}\n", substr($$1,4)} \
}' $(MAKEFILE_LIST)