-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
93 lines (75 loc) · 2.83 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
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
SHELL=/bin/bash
WEBSERVER_HOST ?= localhost
WEBSERVER_PORT ?= 8000
.PHONY: assemble, build, help, lint, lint-fix, login, provision, reset, start, status, stop, test, test-functional, test-kernel, test-unit
help:
@echo "COMMANDS"
@echo "========"
@echo "build - Build or rebuild the project."
@echo "assemble - Assemble a codebase using project code and all required dependencies."
@echo "drush - Run Drush command."
@echo "lint - Check coding standards for violations."
@echo "lint-fix - Fix violations in coding standards."
@echo "login - Run Drush login command."
@echo "provision - Provision application within assembled codebase."
@echo "reset - Reset project to the default state."
@echo "start - Start development environment."
@echo "stop - Stop development environment."
@echo "test - Run all tests."
@echo "test-functional - Run functional tests."
@echo "test-kernel - Run kernel tests."
@echo "test-unit - Run unit tests."
build: stop assemble start provision
assemble:
./.devtools/assemble.sh
start:
./.devtools/start.sh
stop:
./.devtools/stop.sh
# Allow running Drush commands with `make drush <command>`
ifeq (drush,$(firstword $(MAKECMDGOALS)))
DRUSH_RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(DRUSH_RUN_ARGS):;@:)
endif
drush:
build/vendor/bin/drush -l http://$(WEBSERVER_HOST):$(WEBSERVER_PORT) $(DRUSH_RUN_ARGS)
login:
build/vendor/bin/drush -l http://$(WEBSERVER_HOST):$(WEBSERVER_PORT) uli
provision:
./.devtools/provision.sh
lint:
pushd "build" >/dev/null || exit 1 && \
vendor/bin/phpcs && \
vendor/bin/phpstan && \
vendor/bin/rector --clear-cache --dry-run && \
vendor/bin/phpmd . text phpmd.xml && \
vendor/bin/twig-cs-fixer && \
popd >/dev/null || exit 1
lint-fix:
pushd "build" >/dev/null || exit 1 && \
vendor/bin/rector --clear-cache && \
vendor/bin/phpcbf && \
vendor/bin/twig-cs-fixer --no-cache --fix && \
popd >/dev/null || exit 1
test:
pushd "build" >/dev/null || exit 1 && \
BROWSERTEST_OUTPUT_DIRECTORY=/tmp php -d pcov.directory=.. vendor/bin/phpunit && \
popd >/dev/null || exit 1
test-unit:
pushd "build" >/dev/null || exit 1 && \
php -d pcov.directory=.. vendor/bin/phpunit --testsuite unit && \
popd >/dev/null || exit 1
test-kernel:
pushd "build" >/dev/null || exit 1 && \
php -d pcov.directory=.. vendor/bin/phpunit --testsuite kernel && \
popd >/dev/null || exit 1
test-functional:
pushd "build" >/dev/null || exit 1 && \
BROWSERTEST_OUTPUT_DIRECTORY=/tmp php -d pcov.directory=.. vendor/bin/phpunit --testsuite functional && \
popd >/dev/null || exit 1
reset:
killall -9 php >/dev/null 2>&1 || true && \
chmod -Rf 777 build > /dev/null && \
rm -Rf build > /dev/null || true && \
rm -Rf .logs > /dev/null || true
.DEFAULT_GOAL := build