-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
91 lines (68 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
84
85
86
87
88
89
90
91
# ==============================================================================
# Main
http:
export config=local && go run ./cmd/api/http/main.go
grpc:
export config=local && go run ./cmd/api/grpc/main.go
redis-pubsub:
export config=local && go run ./cmd/elasticsearch-indexer-redis/main.go
build:
export config=local &&\
go env -w CGO_ENABLED=1 &&\
go build -o ./bin/api-http ./cmd/api/http/main.go &&\
go build -o ./bin/api-grpc ./cmd/api/grpc/main.go &&\
go build -o ./bin/elasticsearch-indexer-redis ./cmd/elasticsearch-indexer-redis/main.go
# ==============================================================================
# Modules support
deps-reset:
git checkout -- go.mod
go mod tidy
go mod vendor
tidy:
go mod tidy
go mod vendor
deps-upgrade:
# go get $(go list -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' -m all)
go get -u -t -d -v ./...
go mod tidy
go mod vendor
deps-cleancache:
go clean -modcache
# ==============================================================================
# Docker compose commands
develop:
echo "Starting docker environment"
export config=docker
config=docker && docker compose -f docker-compose.yml up --build -d
kill_dev:
echo "Killing docker environment"
docker compose -f docker-compose.yml kill
stop_dev:
echo "Stopping docker environment"
docker compose -f docker-compose.yml stop
remove_dev:
echo "Removing docker environment"
docker compose -f docker-compose.yml down -v
local:
echo "Starting local environment"
export config=local
docker compose -f docker-compose.local.yml up --build -d
kill_local:
echo "Killing docker environment"
docker compose -f docker-compose.local.yml kill
stop_local:
echo "Stopping docker environment"
docker compose -f docker-compose.local.yml stop
remove_local:
echo "Removing docker environment"
docker compose -f docker-compose.local.yml down -v
# ==============================================================================
# Tools
proto_update:
buf mod update ./pkg/grpc/v1
proto_gen:
buf generate ./pkg/grpc/v1
proto_lint:
buf lint ./pkg/grpc/v1
swagger_init:
swag init -g ./cmd/api/http/main.go