-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (23 loc) · 804 Bytes
/
Makefile
File metadata and controls
29 lines (23 loc) · 804 Bytes
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
.PHONY: help
.DEFAULT_GOAL := help
SHELL ?= /bin/bash
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
COMPOSE_EXEC ?= docker-compose exec
# Prefix any command that should be run within the fpm docker container with $(EXEC_FPM)
EXEC_PHP ?= $(COMPOSE_EXEC) php
ifeq (, $(shell which docker-compose))
EXEC_PHP =
endif
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: bash
bash: ## Starts a bash session in the php container
$(COMPOSE_EXEC) php /bin/sh
.PHONY: pre-commit
pre-commit:
$(EXEC_PHP) vendor/bin/php-cs-fixer fix --allow-risky=yes src
$(EXEC_PHP) vendor/bin/phpstan analyse src
$(EXEC_PHP) vendor/bin/phpunit tests
.PHONY: tests
tests:
$(EXEC_PHP) vendor/bin/phpunit tests