-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (46 loc) · 1.76 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
# vim: set foldmarker={,} foldlevel=0 foldmethod=marker:
#
#
# This Makefile is heavily inspired by:
# https://github.com/vincentbernat/hellogopher/blob/master/Makefile
#
.PHONY: help
help: ## Shows help message.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[$$()% 0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
.PHONY: init
init: ## Set up all the necessary requirements to run the repository locally.
@mkdir -p .dev
@mkdir -p .dev/server
@mkdir -p .dev/cli
@mkdir -p .env
@mkdir -p .env/server
@mkdir -p .env/cli
.PHONY: deps
deps: ## Downloads dependencies.
@echo 'Installing dependencies...'
@go mod download
.PHONY: clean
clean: ## Cleans all the possible dirty files generated by the other go commands.
@echo 'Checking for files created by go/coverage...'
@[ -f ./profile.cov ] && rm profile.cov || true
@[ -f ./profile.cov.tmp ] && rm profile.cov.tmp || true
@echo 'checking for the bin folder...'
@[ -d ./bin ] && rm -r ./bin || true
.PHONY: proto-lint
proto-lint: ## Runs the linter for the proto files.
@echo 'Running linter...'
@buf lint
.PHONY: proto-remove
proto-remove: ## Removes files generated based on the proto definitions.
@echo 'Removing previous proto files...'
find . -type f -name \*.pb.gw.go | xargs --no-run-if-empty rm
find . -type f -name \*.pb.go | xargs --no-run-if-empty rm
.PHONY: proto-generate
proto-generate: ## Generates golang code from proto definitions.
@buf generate
@echo 'Done generating protos'
.PHONY: proto
proto: proto-lint proto-remove proto-generate ## Lints and generates proto code
.PHONY: dev
dev: ## Runs the dev environment for all applications.
@docker compose -f docker-compose.yml up