forked from thangchung/go-coffeeshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·83 lines (63 loc) · 2.1 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
72
73
74
75
76
77
78
79
80
81
82
83
include .env
export
all: build test
run: run-product run-counter run-barista run-kitchen run-proxy run-web
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
docker-compose: docker-compose-stop docker-compose-start
.PHONY: docker-compose
docker-compose-start:
docker-compose up --build
.PHONY: docker-compose-start
docker-compose-stop:
docker-compose down --remove-orphans -v
.PHONY: docker-compose-stop
docker-compose-core: docker-compose-core-stop docker-compose-core-start
docker-compose-core-start:
docker-compose -f docker-compose-core.yaml up --build
.PHONY: docker-compose-core-start
docker-compose-core-stop:
docker-compose -f docker-compose-core.yaml down --remove-orphans -v
.PHONY: docker-compose-core-stop
docker-compose-build:
docker-compose down --remove-orphans -v
docker-compose build
.PHONY: docker-compose-build
wire:
cd internal/barista/app && wire && cd - && \
cd internal/counter/app && wire && cd - && \
cd internal/kitchen/app && wire && cd - && \
cd internal/product/app && wire && cd -
.PHONY: wire
sqlc:
sqlc generate
.PHONY: sqlc
test:
go test -v main.go
linter-golangci: ### check by golangci linter
golangci-lint run
.PHONY: linter-golangci
clean:
go clean