-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
135 lines (104 loc) · 2.56 KB
/
Makefile
File metadata and controls
135 lines (104 loc) · 2.56 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Docker compose shorthand
DC := docker compose -f docker-compose.dev.yml
EXEC := $(DC) exec close-powerlifting
.PHONY: help push test lint format up down shell update-fixtures
help:
@echo "Usage: make [target]"
@echo ""
@echo "Development:"
@echo " up Start dev server (fresh db)"
@echo " up-d Start dev server in background"
@echo " down Stop dev server"
@echo " restart Restart dev server"
@echo " log Follow container logs"
@echo " shell Open shell in container"
@echo ""
@echo "Testing:"
@echo " test Run all tests"
@echo " test-watch Run tests in watch mode"
@echo " test-coverage Run tests with coverage"
@echo ""
@echo "Code Quality:"
@echo " lint Run linter"
@echo " format Format code"
@echo " typecheck Run TypeScript type checking"
@echo " check Run lint + format + typecheck"
@echo ""
@echo "Database:"
@echo " db-migrate Run migrations"
@echo " db-rollback Rollback last migration"
@echo " db-seed Run seeders"
@echo " db-reset Rollback + migrate + seed"
@echo ""
@echo "Fixtures:"
@echo " update-fixtures Update OpenPowerlifting test fixtures"
@echo ""
@echo "Deployment:"
@echo " push Test + lint + format + commit + push"
@echo " clean Remove all containers and volumes"
# === Development ===
up:
@rm -rf ./src/db/sqlite/*sqlite*
@$(DC) up
up-d:
@$(DC) up -d
down:
@$(DC) down
restart:
@$(DC) restart close-powerlifting
log:
@$(DC) logs -f
shell:
@$(EXEC) sh
# === Testing ===
test:
@$(EXEC) npm run test
test-watch:
@$(EXEC) npm run test -- --watch
test-coverage:
@$(EXEC) npm run test:coverage
# === Code Quality ===
lint:
@$(EXEC) npm run lint
format:
@$(EXEC) npm run format
typecheck:
@$(EXEC) npx tsc --noEmit
check:
@$(MAKE) lint
@$(MAKE) format
@$(MAKE) typecheck
# === Database ===
db-migrate:
@$(EXEC) npm run db:migrate:latest
db-rollback:
@$(EXEC) npm run db:migrate:rollback
db-seed:
@$(EXEC) npm run db:seed:run
db-reset:
@$(MAKE) db-rollback
@$(MAKE) db-migrate
@$(MAKE) db-seed
db-clean:
@trash ./src/db/sqlite/db.sqlite*
# === Deployment ===
push:
@$(MAKE) test
@$(MAKE) lint
@$(MAKE) format
@git add -A
@curl -s http://commit.jaw.dev/ | sh -s -- --no-verify
@git push --no-verify
clean:
@$(DC) down --rmi all --volumes --remove-orphans
@docker system prune -a -f
@docker volume prune -f
@docker network prune -f
# === Fixtures ===
update-fixtures:
@npm run update:fixtures
# === Misc ===
fix-git:
@git rm -r --cached . -f
@git add .
@git commit -m "Untrack files in .gitignore"