-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (57 loc) · 4.23 KB
/
Makefile
File metadata and controls
83 lines (57 loc) · 4.23 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
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
include .env
export
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
install:
composer install
up: install
docker compose up -d
build:
docker compose build --no-cache
stop:
docker compose stop
down:
docker compose down --remove-orphans --volumes
php-cs-fixer:
composer cs:fix
autoindex:
docker exec -i $${MODULE_VERSION}-ps-prestashop-$${PS_VERSION_TAG} /bin/bash -c "cd modules/ps_checkout && php vendor/bin/autoindex prestashop:add:index /var/www/html/modules/ps_checkout && php vendor/bin/autoindex prestashop:add:index /var/www/html/modules/ps_checkout/vendor"
add-header-stamp:
docker exec -i $${MODULE_VERSION}-ps-prestashop-$${PS_VERSION_TAG} /bin/bash -c "cd modules/ps_checkout && php vendor/bin/header-stamp --license=vendor/prestashop/header-stamp/assets/afl.txt"
lint: php-cs-fixer autoindex
php-unit-api:
docker exec -i $${MODULE_VERSION}-ps-prestashop-$${PS_VERSION_TAG} bash -c "php modules/ps_checkout/vendor/bin/phpunit --configuration=modules/ps_checkout/vendor/invertus/api/tests/phpunit.xml --bootstrap=modules/ps_checkout/vendor/invertus/api/tests/bootstrap.php"
php-unit-infrastructure:
docker exec -i $${MODULE_VERSION}-ps-prestashop-$${PS_VERSION_TAG} bash -c "php modules/ps_checkout/vendor/bin/phpunit --configuration=modules/ps_checkout/vendor/invertus/infrastructure/tests/phpunit.xml --bootstrap=modules/ps_checkout/vendor/invertus/infrastructure/tests/bootstrap.php"
php-unit-utility:
docker exec -i $${MODULE_VERSION}-ps-prestashop-$${PS_VERSION_TAG} bash -c "php modules/ps_checkout/vendor/bin/phpunit --configuration=modules/ps_checkout/vendor/invertus/utility/tests/phpunit.xml --bootstrap=modules/ps_checkout/vendor/invertus/utility/tests/bootstrap.php"
php-unit-core:
docker exec -i $${MODULE_VERSION}-ps-prestashop-$${PS_VERSION_TAG} bash -c "php modules/ps_checkout/vendor/bin/phpunit --configuration=modules/ps_checkout/vendor/invertus/core/tests/phpunit.xml --bootstrap=modules/ps_checkout/vendor/invertus/core/tests/bootstrap.php"
php-unit-presentation:
docker exec -i $${MODULE_VERSION}-ps-prestashop-$${PS_VERSION_TAG} bash -c "php modules/ps_checkout/vendor/bin/phpunit --configuration=modules/ps_checkout/vendor/invertus/presentation/tests/phpunit.xml --bootstrap=modules/ps_checkout/vendor/invertus/presentation/tests/bootstrap.php"
unit-test: php-unit-api php-unit-utility php-unit-core php-unit-presentation
php-integration:
docker exec -i $${MODULE_VERSION}-ps-prestashop-$${PS_VERSION_TAG} bash -c "php modules/ps_checkout/vendor/bin/phpunit --configuration=modules/ps_checkout/tests/phpunit-integration.xml --bootstrap=modules/ps_checkout/tests/bootstrap-integration.php"
php-integration-core:
docker exec -i $${MODULE_VERSION}-ps-prestashop-$${PS_VERSION_TAG} bash -c "php modules/ps_checkout/vendor/bin/phpunit --configuration=modules/ps_checkout/vendor/invertus/core/tests/phpunit-integration.xml --bootstrap=modules/ps_checkout/vendor/invertus/core/tests/bootstrap-integration.php"
php-integration-infrastructure:
docker exec -i $${MODULE_VERSION}-ps-prestashop-$${PS_VERSION_TAG} bash -c "php modules/ps_checkout/vendor/bin/phpunit --configuration=modules/ps_checkout/vendor/invertus/infrastructure/tests/phpunit-integration.xml --bootstrap=modules/ps_checkout/vendor/invertus/infrastructure/tests/bootstrap-integration.php"
integration-test: php-integration php-integration-core php-integration-infrastructure
test: unit-test integration-test
phpstan:
cd $${MODULE_VERSION} && composer phpstan
phpstan-baseline:
cd $${MODULE_VERSION} && composer phpstan:baseline
phpstan-baseline-all:
cd ps17 && composer phpstan:baseline
cd ps8 && composer phpstan:baseline
cd ps9 && composer phpstan:baseline
ssh:
docker exec -it $${MODULE_VERSION}-ps-prestashop-$${PS_VERSION_TAG} bash
install-module:
@if [ -f $${ROOT_DIR}/prestashop/$${PS_VERSION_TAG}/bin/console ]; then \
docker exec -i $${MODULE_VERSION}-ps-prestashop-$${PS_VERSION_TAG} /bin/bash -c "php bin/console prestashop:module install $${MODULE_NAME}"; \
elif [ -f $${ROOT_DIR}/prestashop/$${PS_VERSION_TAG}/app/console ]; then \
docker exec -i $${MODULE_VERSION}-ps-prestashop-$${PS_VERSION_TAG} /bin/bash -c "php app/console prestashop:module install $${MODULE_NAME}"; \
else \
echo "Error: Neither bin/console nor app/console found."; \
fi