-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
50 lines (34 loc) · 1.59 KB
/
Makefile
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
PHP_VERSION=8.1
up: ## Run all containers in all versions
docker compose up -d
down: ## Shut down all containers
docker compose down --remove-orphans
clean: ## Clean vendor/ and composer.lock
rm -rf vendor/ composer.lock
install: ## Run `composer install`
docker compose run php$(PHP_VERSION) composer install
update: ## Run `composer update`
docker compose run php$(PHP_VERSION) composer update $(filter-out $@, $(MAKECMDGOALS))
require: ## Run `composer require`
docker compose run php$(PHP_VERSION) composer require $(filter-out $@, $(MAKECMDGOALS))
remove: ## Run `composer remove`
docker compose run php$(PHP_VERSION) composer remove $(filter-out $@, $(MAKECMDGOALS))
check: cs analyse phpunit ## Run all checks in succession (phpcs, phpunit, phpstan)
phpunit: ## Run phpunit tests
docker compose run php$(PHP_VERSION) vendor/bin/phpunit
analyse: ## Run phpstan analyse
docker compose run php$(PHP_VERSION) vendor/bin/phpstan analyse
cs: ## Run php cs
docker compose run php$(PHP_VERSION) vendor/bin/phpcs
docker compose run php$(PHP_VERSION) composer normalize --dry-run
csfix: ## Run phpcs fixer
docker compose run php$(PHP_VERSION) vendor/bin/phpcbf
docker compose run php$(PHP_VERSION) composer normalize
box: ## Compile /build/composer-unused.phar
docker compose run php$(PHP_VERSION) php box.phar compile
ssh: ## SSH into container
docker compose run php$(PHP_VERSION) /bin/sh
help: ## Displays this list of targets with descriptions
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'
%:
@: