-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
140 lines (110 loc) · 3.91 KB
/
Makefile
File metadata and controls
140 lines (110 loc) · 3.91 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
136
137
138
139
140
# Station - Development Makefile
# Usage: make <target>
.PHONY: help install hooks test test-unit test-feature test-integration test-coverage \
analyse cs-check cs-fix quality shell up down restart logs \
build clean fresh migrate
# Default target
help:
@echo "Station Development Commands"
@echo ""
@echo "Setup:"
@echo " make install Install all dependencies (PHP + Node)"
@echo " make hooks Install Git hooks (pre-commit, pre-push)"
@echo " make build Build frontend assets"
@echo " make fresh Clean install (remove vendors, reinstall)"
@echo ""
@echo "Docker:"
@echo " make up Start all Docker services"
@echo " make up-debug Start with debug tools (Kafka UI, Beanstalkd Console)"
@echo " make down Stop all Docker services"
@echo " make restart Restart all Docker services"
@echo " make logs Show Docker logs (follow mode)"
@echo " make shell Open shell in PHP container"
@echo ""
@echo "Testing:"
@echo " make test Run all tests"
@echo " make test-unit Run unit tests only"
@echo " make test-feature Run feature tests only"
@echo " make test-integration Run integration tests only"
@echo " make test-coverage Run tests with coverage report"
@echo " make test-filter F=<name> Run specific test by name"
@echo ""
@echo "Code Quality:"
@echo " make analyse Run PHPStan static analysis"
@echo " make cs-check Check code style (dry-run)"
@echo " make cs-fix Fix code style issues"
@echo " make quality Run all quality checks (analyse + cs-check + test)"
@echo ""
@echo "Database:"
@echo " make migrate Run database migrations"
@echo ""
@echo "Utilities:"
@echo " make clean Remove generated files and caches"
# ===========================================
# Setup
# ===========================================
install:
composer install
npm install
hooks:
./scripts/install-hooks.sh
build:
npm run build
fresh: clean
rm -rf vendor node_modules
composer install
npm install
npm run build
# ===========================================
# Docker
# ===========================================
up:
docker compose up -d
up-debug:
docker compose --profile debug up -d
down:
docker compose down
restart: down up
logs:
docker compose logs -f
shell:
docker exec -it station_php sh
# ===========================================
# Testing
# ===========================================
test:
docker exec station_php bash -c "XDEBUG_MODE=off php vendor/bin/phpunit"
test-unit:
docker exec station_php bash -c "XDEBUG_MODE=off php vendor/bin/phpunit --testsuite=Unit"
test-feature:
docker exec station_php bash -c "XDEBUG_MODE=off php vendor/bin/phpunit --testsuite=Feature"
test-integration:
docker exec station_php bash -c "XDEBUG_MODE=off php vendor/bin/phpunit --testsuite=Integration"
test-coverage:
docker exec station_php bash -c "XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-html coverage"
test-filter:
docker exec station_php bash -c "XDEBUG_MODE=off php vendor/bin/phpunit --filter $(F)"
# ===========================================
# Code Quality
# ===========================================
analyse:
docker exec station_php bash -c "./vendor/bin/phpstan analyse"
cs-check:
docker exec station_php bash -c "./vendor/bin/php-cs-fixer fix --dry-run --diff"
cs-fix:
docker exec station_php bash -c "./vendor/bin/php-cs-fixer fix"
quality: analyse cs-check test
# ===========================================
# Database
# ===========================================
migrate:
docker exec station_php bash -c "php artisan migrate"
# ===========================================
# Utilities
# ===========================================
clean:
rm -rf coverage
rm -rf .phpunit.cache
rm -rf .php-cs-fixer.cache
docker exec station_php bash -c "php artisan cache:clear" 2>/dev/null || true
docker exec station_php bash -c "php artisan config:clear" 2>/dev/null || true