2026-04-21 17:56:04 +02:00
|
|
|
.PHONY: help start start-build stop build down ps logs prune-everything db-reset mercure-jwt cache-clear og-cache-clear test-db-setup test-db-reset test
|
2026-04-13 11:56:50 +02:00
|
|
|
|
|
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
|
|
|
|
|
|
help:
|
|
|
|
|
@echo "Available commands:"
|
|
|
|
|
@echo " make start - Start services without building (uses existing images)"
|
|
|
|
|
@echo " make start-build - Start services and build images if needed"
|
|
|
|
|
@echo " make stop - Stop running services"
|
|
|
|
|
@echo " make build - Build Docker images only"
|
|
|
|
|
@echo " make down - Stop and remove containers/networks"
|
|
|
|
|
@echo " make prune-everything - Prune volumes, networks and images (DANGEROUS!)"
|
|
|
|
|
@echo " make db-reset - Reset the database (drop, create, migrate) (DANGEROUS!)"
|
2026-04-18 11:42:46 +02:00
|
|
|
@echo " make ccp - Clear the production cache"
|
2026-04-18 13:44:15 +02:00
|
|
|
@echo " make cache-clear - Clear all caches (Vite, Symfony, node_modules)"
|
|
|
|
|
@echo " make og-cache-clear - Clear Open Graph cache only"
|
2026-04-21 17:56:04 +02:00
|
|
|
@echo " make test-db-setup - One-time setup: Create test database and run migrations"
|
|
|
|
|
@echo " make test-db-reset - Reset test database (drop, create, migrate)"
|
|
|
|
|
@echo " make test - Run PHPUnit tests"
|
2026-04-13 11:56:50 +02:00
|
|
|
|
|
|
|
|
start:
|
|
|
|
|
docker compose up -d
|
|
|
|
|
|
|
|
|
|
start-build:
|
2026-04-13 15:50:28 +02:00
|
|
|
composer i
|
|
|
|
|
bun run build
|
2026-04-13 11:56:50 +02:00
|
|
|
docker compose up -d --build
|
|
|
|
|
|
|
|
|
|
stop:
|
|
|
|
|
docker compose stop
|
|
|
|
|
|
|
|
|
|
build:
|
|
|
|
|
docker compose build
|
|
|
|
|
|
|
|
|
|
down:
|
|
|
|
|
docker compose down
|
|
|
|
|
|
|
|
|
|
prune-everything:
|
|
|
|
|
@echo "WARNING: This will remove ALL containers, volumes, networks and images!"
|
|
|
|
|
@read -p "Type 'yes' to confirm: " confirm; \
|
|
|
|
|
if [ "$$confirm" != "yes" ]; then \
|
|
|
|
|
echo "Aborted."; \
|
|
|
|
|
exit 1; \
|
|
|
|
|
fi
|
|
|
|
|
docker compose down -v --rmi all --remove-orphans
|
|
|
|
|
|
2026-04-13 16:10:41 +02:00
|
|
|
mercure-jwt:
|
|
|
|
|
@php bin/generate-mercure-jwt.php
|
|
|
|
|
|
2026-04-13 11:56:50 +02:00
|
|
|
db-reset:
|
|
|
|
|
@echo "WARNING: This will DROP and RECREATE the database!"
|
|
|
|
|
@read -p "Type 'yes' to confirm: " confirm; \
|
|
|
|
|
if [ "$$confirm" != "yes" ]; then \
|
|
|
|
|
echo "Aborted."; \
|
|
|
|
|
exit 1; \
|
|
|
|
|
fi
|
|
|
|
|
bin/console doctrine:database:drop --force --if-exists --no-interaction
|
|
|
|
|
bin/console doctrine:database:create --if-not-exists --no-interaction
|
|
|
|
|
bin/console doctrine:migrations:migrate --no-interaction
|
2026-04-18 11:42:46 +02:00
|
|
|
|
|
|
|
|
ccp:
|
|
|
|
|
bin/console cache:clear --no-warmup --env=prod
|
2026-04-18 13:44:15 +02:00
|
|
|
|
|
|
|
|
cache-clear:
|
|
|
|
|
@echo "Clearing all caches..."
|
|
|
|
|
@rm -rf node_modules/.vite
|
|
|
|
|
@rm -rf .vite
|
|
|
|
|
@rm -rf var/og-cache
|
|
|
|
|
@php bin/console cache:clear --no-warmup
|
|
|
|
|
@echo "✓ Vite cache cleared"
|
|
|
|
|
@echo "✓ OG cache cleared"
|
|
|
|
|
@echo "✓ Symfony cache cleared"
|
|
|
|
|
@echo ""
|
|
|
|
|
@echo "Rebuilding assets..."
|
|
|
|
|
@bun run build
|
|
|
|
|
@echo ""
|
|
|
|
|
@echo "✓ All caches cleared and assets rebuilt!"
|
|
|
|
|
@echo " Next step: Refresh browser with Ctrl+Shift+R"
|
|
|
|
|
|
|
|
|
|
og-cache-clear:
|
|
|
|
|
@echo "Clearing Open Graph cache..."
|
|
|
|
|
@rm -rf var/og-cache
|
|
|
|
|
@echo "✓ OG cache cleared!"
|
|
|
|
|
@echo " Battle card images will be regenerated on next access"
|
|
|
|
|
|
2026-04-21 17:56:04 +02:00
|
|
|
test-db-setup:
|
|
|
|
|
@echo "Setting up test database..."
|
|
|
|
|
@bin/console dbal:run-sql "SELECT 1 FROM pg_database WHERE datname='mineseeker_test'" 2>/dev/null | grep -q 1 || \
|
|
|
|
|
(bin/console dbal:run-sql "CREATE DATABASE mineseeker_test" && echo "✓ Database 'mineseeker_test' created")
|
|
|
|
|
@bin/console doctrine:migrations:migrate --env=test --no-interaction --allow-no-migration 2>&1 | grep -v "WARNING" || true
|
|
|
|
|
@echo "✓ Test database setup complete!"
|
|
|
|
|
@echo " Database: mineseeker_test"
|
|
|
|
|
@echo " Run tests with: make test"
|
|
|
|
|
|
|
|
|
|
test-db-reset:
|
|
|
|
|
@echo "Resetting test database..."
|
|
|
|
|
@bin/console dbal:run-sql "DROP DATABASE IF EXISTS mineseeker_test" --quiet
|
|
|
|
|
@bin/console dbal:run-sql "CREATE DATABASE mineseeker_test" --quiet
|
|
|
|
|
@bin/console doctrine:migrations:migrate --env=test --no-interaction --quiet
|
|
|
|
|
@echo "✓ Test database reset complete!"
|
|
|
|
|
@echo " Database: mineseeker_test"
|
|
|
|
|
@echo " Run tests with: make test"
|
|
|
|
|
|
|
|
|
|
test:
|
|
|
|
|
@php -d memory_limit=512M bin/phpunit --testdox --colors=always
|