-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (35 loc) · 968 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
42
43
44
.DEFAULT_GOAL := help
# Environment variables
DB_DATABASE := app
DB_USER := app
DB_PORT := 5432
.PHONY: run
run: ## Start Application
@docker compose up -d
.PHONY: generate
generate: ## Generate code
@rm -rf internal/infra/grpc/generated
@buf generate ./api/proto
@gqlgen generate
@sqlboiler psql
@cd api/http && oapi-codegen -config config.yml openapi.yml
.PHONY: fmt
fmt: ## Format code
@go fmt ./...
@buf format -w ./api/proto
.PHONY: lint
lint: ## Lint code
@buf lint ./api/proto
@golangci-lint run
.PHONY: clear
clear: ## Clear Application
@docker compose down --volumes
.PHONY: logs
logs: ## Show API server logs
@docker compose logs -f api_server
psql: ## Login PostgreSQL
@psql --host localhost --port $(DB_PORT) --username $(DB_USER) --dbname ${DB_DATABASE} --password
.PHONY: help
help: ## Show help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'