-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
executable file
·39 lines (36 loc) · 1.55 KB
/
makefile
File metadata and controls
executable file
·39 lines (36 loc) · 1.55 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
GNUMAKEFLAGS+=--no-print-directory --output-sync
RUN_ARGS:= $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(RUN_ARGS):;@:)
cmd=
help: ## Display this help message
@cat $(MAKEFILE_LIST) | grep -e "^[a-zA-Z_\-]*: *.*## *" | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
docker-clean: ## Remove containers, network, images and volumes
docker compose down --rmi all --volumes --remove-orphans
build: ## Build docker images
docker compose build $(or $(services),${RUN_ARGS})
logs: ## Show logs
docker compose logs -f $(or $(services),${RUN_ARGS})
deps: ## Install dependencies
@$(MAKE) composer cmd="install"
require: ## Require new dependency
@$(MAKE) composer cmd="require $(or $(opts),) ${pkg}"
.PHONY: tests
tests: ## Run tests
@$(MAKE) run service=php cmd="rm -rf var/phpunit"
@$(MAKE) php cmd="vendor/bin/phpunit tests"
cs: ## Executes php cs fixer for updated or new files
@$(MAKE) php cmd="vendor/bin/phpcs $(or $(opts),)"
check: ## Executes php cs fixer in dry run mode for updated or new files
@$(MAKE) cs opts=" --dry-run"
style: ## Executes php analyzers
@$(MAKE) php cmd='vendor/bin/phpstan analyse'
lint:
@$(MAKE) php cmd='vendor/bin/grumphp run --testsuite=lint'
sh: ## Interactive shell inside docker
@$(MAKE) run service?=php cmd=sh
composer: ## Interactive composer
@$(MAKE) run service=composer cmd="$(or $(cmd),${RUN_ARGS})"
php: ## Run PHP interpreter
@$(MAKE) run service=php cmd="php $(or $(cmd),"${RUN_ARGS}")"
run: ## Run any command inside docker container
docker compose run --rm ${service} ${cmd}