-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
65 lines (51 loc) · 2.88 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
.DEFAULT_GOAL := help
filter := "default"
dirname := $(notdir $(CURDIR))
envprefix := $(shell echo "$(dirname)" | tr A-Z a-z)
envname := $(envprefix)test
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: help
init: composer-install install-hooks install-plugin install-test-environment ## install the plugin with pre commit hook, requirements and the test environment
init-legacy: composer-install install-hooks ## install the plugin in SW 5.2.27 (latest 5.2) with pre commit hook, requirements and the test environment. Requires SwagCookieConsentManager with branch 5.2.11-5.2.27
php ./../../../bin/console sw:database:setup --steps=drop,create,import,importDemodata --env=$(envname)
php ./../../../bin/console sw:cache:clear --env=$(envname)
php ./../../../bin/console sw:database:setup --steps=setupShop --shop-url=http://localhost --env=$(envname)
php ./../../../bin/console sw:snippets:to:db --include-plugins --env=$(envname)
php ./../../../bin/console sw:theme:initialize --env=$(envname)
php ./../../../bin/console sw:firstrunwizard:disable --env=$(envname)
php ./../../../bin/console sw:admin:create --name="Demo" --email="[email protected]" --username="demo" --password="demo" --locale=de_DE -n --env=$(envname)
touch ./../../../recovery/install/data/install.lock
php ./../../../bin/console sw:plugin:refresh --env=$(envname)
php ./../../../bin/console sw:plugin:install $(dirname) --activate --env=$(envname)
php ./../../../bin/console sw:cache:clear --env=$(envname)
composer-install: ## Install composer requirements
@echo "Install composer requirements"
composer install
install-hooks: ## Install pre commit hooks
@echo "Install pre commit hooks"
.githooks/install_hooks.sh
install-plugin: .refresh-plugin-list ## Install and activate the plugin
@echo "Install the plugin"
./../../../bin/console sw:plugin:install $(dirname) --activate
./../../../bin/console sw:cache:clear
install-test-environment: ## Installs the plugin test environment
@echo "Install the test environment"
./psh local:init
run-tests: ## Execute the php unit tests... (You can use the filter parameter "make run-tests filter=yourFilterPhrase")
ifeq ($(filter), "default")
SHOPWARE_ENV=$(envname) ./../../../vendor/phpunit/phpunit/phpunit --verbose
else
SHOPWARE_ENV=$(envname) ./../../../vendor/phpunit/phpunit/phpunit --verbose --filter $(filter)
endif
fix-cs: ## Run the code style fixer
./../../../vendor/bin/php-cs-fixer fix
fix-cs-dry: ## Run the code style fixer in dry mode
./../../../vendor/bin/php-cs-fixer fix --dry-run -vvv
phpstan: ## Run PHPStan
./../../../vendor/bin/phpstan analyse .
phpstan-generate-baseline: ## Run PHPStan and generate a baseline file
./../../../vendor/bin/phpstan analyse . --generate-baseline
.refresh-plugin-list:
@echo "Refresh the plugin list"
./../../../bin/console sw:plugin:refresh