Website/app/Makefile

92 lines
3.6 KiB
Makefile
Raw Normal View History

2024-02-19 21:23:38 +00:00
##|——[ General ]—————————————————————————————————————————————————————————————————————————|
help: ## Shops available commands
@bin/make/help.sh
2024-02-04 02:46:53 +00:00
2024-02-19 21:23:38 +00:00
check: ## Checks whether requirements are met
@bin/make/check.sh
2024-02-04 02:46:53 +00:00
2024-02-19 21:23:38 +00:00
##|——[ Local Server ]————————————————————————————————————————————————————————————————————|
up: ## Starts the Local Instance
@make down -s
@make check -s
@docker compose up -d
@symfony local:server:start -d --no-tls
@bash -c '$$(npm run watch >> var/log/encore.log)& echo $$! > ./npm-watch.pid'
2024-02-04 02:46:53 +00:00
2024-02-19 21:23:38 +00:00
down: ## Stops the Local Instance
2024-02-04 02:46:53 +00:00
ifneq (,$(wildcard ./npm-watch.pid))
@printf "${RED}Killing ${YELLOW}Encore${CLEAR}!\n"
2024-04-22 18:52:51 +00:00
@- kill $$(cat ./npm-watch.pid)
2024-02-04 02:46:53 +00:00
@rm -rf ./npm-watch.pid
endif
2024-02-19 21:23:38 +00:00
@symfony local:server:stop
@docker compose down
2024-02-04 02:46:53 +00:00
fresh: ## Starts a Fresh Local Instance
2024-02-19 21:23:38 +00:00
@make down -s
2024-02-29 21:49:41 +00:00
@symfony composer install
@npm i
@make up -s
@make db-demo -s
2024-02-04 02:46:53 +00:00
2024-02-19 21:23:38 +00:00
##|——[ Code Quality ]————————————————————————————————————————————————————————————————————|
test: ## Runs all Unittests
2024-04-22 18:52:51 +00:00
@docker compose up -d
@symfony console doctrine:database:drop --if-exists --force --env=test
@symfony console doctrine:database:create --env=test
@symfony console doctrine:migrations:migrate -n --env=test
@symfony console doctrine:fixtures:load -n --env=test
@symfony console cache:clear --env=test
2024-02-19 21:23:38 +00:00
vendor/bin/phpunit
2024-02-04 02:46:53 +00:00
analyze: ## Runs Static Code Analysis
vendor/bin/phpstan analyze
2024-02-19 21:23:38 +00:00
lint: ## Runs the Linters
@make lint-php -s
@make lint-ts -s
@make lint-twig -s
2024-04-22 18:52:51 +00:00
@make lint-scss -s
##|——[ Testing ]—————————————————————————————————————————————————————————————————————————|
test-unit: ## Runs the Unit tests
vendor/bin/phpunit --testsuite Unit
test-integration: ## Runs the Integration tests
@symfony console doctrine:fixtures:load -n --env=test
vendor/bin/phpunit --testsuite Integration
2024-02-19 21:23:38 +00:00
2024-04-22 18:52:51 +00:00
test-web: ## Runs the Web tests
@symfony console doctrine:fixtures:load -n --env=test
vendor/bin/phpunit --testsuite Web
##|——[ Linting ]—————————————————————————————————————————————————————————————————————————|
2024-02-19 21:23:38 +00:00
lint-php: ## Runs the PHP Linting
vendor/bin/php-cs-fixer fix --allow-risky=yes
lint-ts: ## Runs the Typescript Linting
2024-04-22 18:52:51 +00:00
npm run lint:ts:fix
2024-02-19 21:23:38 +00:00
lint-twig: ## Runs Twig Linting
vendor/bin/twig-cs-fixer lint --fix
php bin/console lint:twig
2024-02-04 02:46:53 +00:00
2024-04-22 18:52:51 +00:00
lint-scss: ## Runs Twig Linting
npm run lint:scss:fix
2024-02-19 21:23:38 +00:00
##|——[ Data ]————————————————————————————————————————————————————————————————————————————|
2024-02-04 02:46:53 +00:00
db-demo: ## Writes the Demo Data to the Local Instance
2024-02-29 21:49:41 +00:00
symfony console doctrine:database:drop --if-exists --force
symfony console doctrine:database:create
2024-04-22 18:52:51 +00:00
symfony console doctrine:migrations:migrate -n
2024-02-04 02:46:53 +00:00
symfony console doctrine:fixtures:load -n
symfony console cache:clear
db-migration-gen: ## Generates a Migration
symfony console doctrine:migration:diff
db-migration-do: ## Does the Migration
2024-02-29 21:49:41 +00:00
symfony console doctrine:migration:migrate