-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMakefile
More file actions
102 lines (78 loc) · 2.74 KB
/
Makefile
File metadata and controls
102 lines (78 loc) · 2.74 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
.DEFAULT_GOAL := help
.PHONY: help
help: ## Show available commands
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: route-list
route-list: ## List all registered routes
@php artisan route:list --except-vendor --ansi
.PHONY: pint
pint: ## Run Pint code style fixer
@export XDEBUG_MODE=off
@$(CURDIR)/vendor/bin/pint --parallel
@unset XDEBUG_MODE
.PHONY: test-pint
test-pint: ## Run Pint code style fixer in test mode
@export XDEBUG_MODE=off
@$(CURDIR)/vendor/bin/pint --test --parallel
@unset XDEBUG_MODE=off
.PHONY: rector
rector: ## Run Rector
@$(CURDIR)/vendor/bin/rector process
.PHONY: test-rector
test-rector: ## Run Rector in test mode
@$(CURDIR)/vendor/bin/rector process --dry-run
.PHONY: phpstan
phpstan: ## Run PHPStan
@$(CURDIR)/vendor/bin/phpstan analyse --ansi --memory-limit=2G
.PHONY: p
p: phpstan ## Alias for phpstan
.PHONY: test-phpstan
test-phpstan: ## Run PHPStan in test mode
@$(CURDIR)/vendor/bin/phpstan analyse --ansi
.PHONY: format
format: rector pint ## Run Pint and Rector and try to fixes the source code
.PHONY: f
f: format ## Alias for format
.PHONY: check
check: test-rector test-pint test-phpstan ## Run Pint, PHPStan with Rector in dry-run mode
.PHONY: test
test: ## Run all tests
@$(CURDIR)/vendor/bin/pest --compact
.PHONY: t
t: test ## Alias for test
.PHONY: test-unit
test-unit: ## Run unit tests
@$(CURDIR)/vendor/bin/pest --compact --group=unit
.PHONY: test-feature
test-feature: ## Run feature tests
@$(CURDIR)/vendor/bin/pest --compact --group=feature
.PHONY: setup-test-db
setup-test-db: ## Create the testing database for running tests
@PGHOST=localhost PGUSER=postgres PGPASSWORD=postgres createdb test_he4rtbot 2>/dev/null || echo "Database test_he4rtbot already exists"
.PHONY: migrate-fresh
migrate-fresh: ## Run migrations and seed the database
@php artisan migrate:fresh --seed
.PHONY: env-up
env-up: ## Start the development environment
@docker compose --file docker-compose.yml up --detach
.PHONY: env-down
env-down: ## Start the development environment
@docker compose --file docker-compose.yml down --rmi all --volumes
.PHONY: dev
dev: ## Start the server
@composer run-script dev
.PHONY: setup
setup: ## Setup the project
@composer install
@npm install
@composer run-script post-root-package-install
@composer run-script post-create-project-cmd
@php artisan key:generate --ansi
@php artisan storage:link --ansi
@composer run-script ide-helper
.PHONY: import-db
import-db: ## Import a PostgreSQL dump file (usage: make import-db file=path/to/dump)
@PGHOST=localhost PGUSER=postgres PGPASSWORD=postgres pg_restore -x -O -cC -j 8 -d postgres $(file)
.PHONY: bot
bot: ## Run the Discord bot
@php artisan bot:boot