-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
94 lines (73 loc) · 2.99 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
92
93
94
AUTH_DIR := ./components/auth
INFRA_DIR := ./components/infra
LEDGER_DIR := ./components/ledger
TRANSACTION_DIR := ./components/transaction
.PHONY: auth ledger transaction
help:
@echo "Management commands"
@echo ""
@echo "Usage:"
@echo " ## Root Commands"
@echo " make build Build all project services."
@echo " make test Run tests on all projects."
@echo " make clean Clean the directory tree of produced artifacts."
@echo " make lint Run static code analysis (lint)."
@echo " make format Run code formatter."
@echo " make checkEnvs Check if github hooks are installed and secret env on files are not exposed."
@echo " make auth Run a command inside the auth app in the components directory to see available commands."
@echo " make infra Run a command inside the infra app in the components directory to see available commands."
@echo " make ledger Run a command inside the ledger app in the components directory to see available commands."
@echo " make transaction Run a command inside the transaction app in the components directory to see available commands."
@echo " make set-env Run a command to copy all .env.example to .env into respective folders."
@echo " make all-services Run a command to all services passing any individual container command."
@echo ""
@echo " ## Utility Commands"
@echo " make setup-git-hooks Command to setup git hooks."
@echo ""
build:
./make.sh "build"
test:
go test -v ./... ./...
cover:
go test -cover ./...
clean:
./make.sh "clean"
lint:
./make.sh "lint"
format:
./make.sh "format"
check-logs:
./make.sh "checkLogs"
check-tests:
./make.sh "checkTests"
setup-git-hooks:
./make.sh "setupGitHooks"
goreleaser:
goreleaser release --snapshot --skip-publish --rm-dist
tidy:
go mod tidy
sec:
gosec ./...
set-env:
cp -r $(AUTH_DIR)/.env.example $(AUTH_DIR)/.env
cp -r $(INFRA_DIR)/.env.example $(INFRA_DIR)/.env
cp -r $(LEDGER_DIR)/.env.example $(LEDGER_DIR)/.env
cp -r $(TRANSACTION_DIR)/.env.example $(TRANSACTION_DIR)/.env
up:
docker-compose -f $(AUTH_DIR)/docker-compose.yml up --build -d && \
docker-compose -f $(INFRA_DIR)/docker-compose.yml up --build -d && \
docker-compose -f $(LEDGER_DIR)/docker-compose.yml up --build -d && \
docker-compose -f $(TRANSACTION_DIR)/docker-compose.yml up --build -d
auth:
$(MAKE) -C $(AUTH_DIR) $(COMMAND)
infra:
$(MAKE) -C $(INFRA_DIR) $(COMMAND)
ledger:
$(MAKE) -C $(LEDGER_DIR) $(COMMAND)
transaction:
$(MAKE) -C $(TRANSACTION_DIR) $(COMMAND)
all-services:
$(MAKE) -C $(AUTH_DIR) $(COMMAND) && \
$(MAKE) -C $(INFRA_DIR) $(COMMAND) && \
$(MAKE) -C $(LEDGER_DIR) $(COMMAND) && \
$(MAKE) -C $(TRANSACTION_DIR) $(COMMAND)