-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
41 lines (30 loc) · 925 Bytes
/
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
# variable
PORT = 40000
DOCKER_IMAGE_NAME = "goapp"
DOCKER_CONTAINER_NAME = "goapp"
# command docker
build: clear
@docker build --build-arg TAGGED=builder-${DOCKER_IMAGE_NAME} -f Dockerfile --tag $(DOCKER_IMAGE_NAME) .
run: clear
@docker run --restart=always -d --name $(DOCKER_CONTAINER_NAME) -p $(PORT):$(PORT) $(DOCKER_IMAGE_NAME)
# development
clear:
@clear
dev: clear
@go run cmd/echo/main.go
watch: clear
@reflex -r '\.go' -s -- sh -c "go run cmd/echo/main.go"
test: clear
@go test ./internal/... ./pkg/...
cover: clear
@go test ./internal/... ./pkg/... -coverprofile=cover.out
@go tool cover -html=cover.out
code-check: clear
@staticcheck ./...
mock:
@rm -rf mocks/*.go
@mockery --dir=internal/port --all
# gRPC
gen-proto: clear
@protoc --go_out=. --go-grpc_out=. api/protobuf/**
# @docker build --build-arg TAGGED=builder-${DOCKER_IMAGE_NAME} --file Dockerfile --tag $(DOCKER_IMAGE_NAME) .