forked from Shoshuo/Prismarr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (59 loc) · 2.26 KB
/
Copy pathMakefile
File metadata and controls
76 lines (59 loc) · 2.26 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
DEV_COMPOSE = docker compose --env-file symfony/.env.local -f docker-compose.yml -f docker-compose.dev.yml
COMPOSER = docker run --rm -v "$(shell pwd)/symfony:/app" composer:2
# Dev (bind mounts live, APP_ENV=dev)
dev:
$(DEV_COMPOSE) up -d --build
# Prod (image baked)
prod:
docker compose --env-file symfony/.env.local up -d --build
# Force-recreate the container after env/config change (rebuild included)
restart:
$(DEV_COMPOSE) up -d --build --force-recreate prismarr
# Full stop
stop:
docker compose down
# Container logs (FrankenPHP + worker interleaved)
logs:
docker logs prismarr -f
# Rebuild image without cache
build:
$(DEV_COMPOSE) build --no-cache
# Install a Composer package
composer:
$(COMPOSER) $(filter-out $@,$(MAKECMDGOALS))
# Symfony console command inside the container
console:
docker exec prismarr php bin/console $(filter-out $@,$(MAKECMDGOALS))
# First-boot initialization: create the SQLite DB
init:
docker exec prismarr mkdir -p var/data
docker exec prismarr php bin/console doctrine:schema:create --no-interaction
# Run the PHPUnit test suite (full suite — no args).
# APP_ENV=test is passed explicitly because the container default is
# prod (or dev with the override file), and the `<server>` directive in
# phpunit.dist.xml is not always honored before the kernel boots.
test:
docker exec -e APP_ENV=test prismarr vendor/bin/phpunit
# Lint all PHP sources (syntax errors only — fast)
lint:
docker exec prismarr sh -c 'find src tests migrations -name "*.php" -exec php -l {} \; 2>&1 | grep -v "No syntax errors" || echo "PHP syntax OK"'
# Lint Twig templates
lint-twig:
docker exec prismarr php bin/console lint:twig templates
# Lint Symfony container + YAML config
lint-container:
docker exec prismarr php bin/console lint:container
docker exec prismarr php bin/console lint:yaml config
# Full pre-commit check — run this before every `git commit`.
# Required by CONTRIBUTING.md Definition of Done.
check: lint lint-twig test
@echo ""
@echo "✓ make check passed — ready to commit"
# Generate a new Doctrine migration from current entities
migrations-diff:
docker exec prismarr php bin/console doctrine:migrations:diff
# Show migrations status
migrations-status:
docker exec prismarr php bin/console doctrine:migrations:status
%:
@: