forked from thangchung/go-coffeeshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·71 lines (54 loc) · 1.87 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
include .env
export
PRODUCT_BINARY_NAME=product.out
PROXY_BINARY_NAME=proxy.out
all: build test
build-product:
go build -tags migrate -o ./cmd/product/${PRODUCT_BINARY_NAME} github.com/thangchung/go-coffeeshop/cmd/product
build-proxy:
go build -tags migrate -o ./cmd/proxy/${PROXY_BINARY_NAME} github.com/thangchung/go-coffeeshop/cmd/proxy
run-product:
cd cmd/product && go mod tidy && go mod download && \
CGO_ENABLED=0 go run github.com/thangchung/go-coffeeshop/cmd/product
.PHONY: run-product
run-counter:
cd cmd/counter && go mod tidy && go mod download && \
CGO_ENABLED=0 go run -tags migrate github.com/thangchung/go-coffeeshop/cmd/counter
.PHONY: run-counter
run-barista:
cd cmd/barista && go mod tidy && go mod download && \
CGO_ENABLED=0 go run -tags migrate github.com/thangchung/go-coffeeshop/cmd/barista
.PHONY: run-barista
run-kitchen:
cd cmd/kitchen && go mod tidy && go mod download && \
CGO_ENABLED=0 go run -tags migrate github.com/thangchung/go-coffeeshop/cmd/kitchen
.PHONY: run-kitchen
run-proxy:
cd cmd/proxy && go mod tidy && go mod download && \
CGO_ENABLED=0 go run -tags migrate github.com/thangchung/go-coffeeshop/cmd/proxy
.PHONY: run-proxy
run-web:
cd cmd/web && go mod tidy && go mod download && \
CGO_ENABLED=0 go run github.com/thangchung/go-coffeeshop/cmd/web
.PHONY: run-web
test:
go test -v main.go
package:
docker-compose down --remove-orphans -v
docker-compose build
.PHONY: package
compose-up: ### Run docker-compose
docker-compose up --build -d postgres && docker-compose logs -f
.PHONY: compose-up
compose-down: ### Down docker-compose
docker-compose down --remove-orphans
.PHONY: compose-down
docker-rm-volume: ### remove docker volume
docker volume rm go-clean-template_pg-data
.PHONY: docker-rm-volume
linter-golangci: ### check by golangci linter
golangci-lint run
.PHONY: linter-golangci
clean:
go clean
rm ${PRODUCT_BINARY_NAME}