-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (54 loc) · 1.7 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
## Proto files commands
.PHONY: generate-proto-protoc
generate-proto-protoc:
@echo "Generating proto files"
protoc -I ./api \
--go_out ./pkg --go_opt paths=source_relative \
--go-grpc_out ./pkg --go-grpc_opt paths=source_relative \
--grpc-gateway_out ./pkg --grpc-gateway_opt paths=source_relative \
./api/protobuf/*.proto ./api/google/api/*.proto ./api/google/type/*.proto
.PHONY: generate-proto
generate-proto:
@echo "Generating proto files using buf"
buf generate api
.PHONY: clean-proto
clean-proto:
@echo "Cleaning generated proto files"
rm -rf pkg/{protobuf,google}
## CLI commands
.PHONY: build-cli
build-cli:
@echo "Building okane cli app"
go build -o okane_cli ./okanecli
.PHONY: rm-cli
rm-cli:
@echo "Removing okane cli app"
rm -rf okane_cli
## Server commands
.PHONY: lint
lint:
@echo "Linting code using golangci-lint"
golangci-lint run ./...
.PHONY: run-server
run-server:
@echo "Starting Okane server"
go run cmd/main.go
## Development Server docker-compose commands
DOCKER_COMPOSE_DEV_FILE=docker-compose-dev.yml
DOCKER_COMPOSE_DEV_SERVER_SERVICE=okane_api
.PHONY: compose-dev-build
compose-dev-build:
@echo "Running Okane API docker compose dev build"
docker compose -f $(DOCKER_COMPOSE_DEV_FILE) build
.PHONY: compose-dev-up
compose-dev-up:
@echo "Running Okane API docker compose dev up in detach mode"
docker compose -f $(DOCKER_COMPOSE_DEV_FILE) up -d
.PHONY: compose-dev-logs
compose-dev-logs:
@echo "Running Okane API docker compose dev logs"
docker compose -f $(DOCKER_COMPOSE_DEV_FILE) logs $(DOCKER_COMPOSE_DEV_SERVER_SERVICE) -f
.PHONY: compose-dev-down
compose-dev-down:
@echo "Running Okane API docker compose dev down"
docker compose -f $(DOCKER_COMPOSE_DEV_FILE) down